[thelist] MySQL insert error.

Ken Moore ken at abqnets.com
Tue Sep 2 11:13:01 CDT 2003


Hi all,

I am running on a remote server (Interland, inc.) using FreeBSD. I have a
MySQL database created by root. The problem is an insert error from a PHP
script.

This command works:   @ $db =
MYSQL_PCONNECT('localhost','user_name','user_pass');

This one did work but now does not:
$result = mysql_query("insert into client_interest values ('$email',
'$arr[$i]', '$arr[$j]')");

All pertinent info on permissions is below.

I am going crazy. If anyone can help, I will be in your debt.


Respectfully,

Ken Moore
ken at abqnets.com 



This is the table:
mysql> use clients;
Database changed
mysql> desc client_interest;
+--------------+-------------+------+-----+---------+-------+
| Field        | Type        | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| client_email | varchar(40) | YES  |     | NULL    |       |
| item         | varchar(40) | YES  |     | NULL    |       |
| level        | varchar(10) | YES  |     | NULL    |       |
+--------------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)



PERMISSIONS - I HAVE INCLUDED ONLY THE "Y". IF YOU DO NOT SEE THE COLUMN
HEADING, IT IS "N".

mysql> select * from host where  host="localhost";

+-----------+-----------------+-------------+-------------+-------------+---
-
| Host      | Db              | Select_priv | Insert_priv | Update_priv|
+-----------+-----------------+-------------+-------------+----------------
| localhost | client_interest | Y           | Y           | Y           |
| localhost | clients         | Y           | Y           | Y           |
+-----------+-----------------+-------------+-------------+-------------+
2 rows in set (0.00 sec)


mysql> select * from db where user="wfa_user" and host="localhost";

+-----------+-----------------+----------+-------------+-------------+------
----------+--------------+---------------+-------------+-------------+------
--------+------------+
| Host        | Db                   | User      | Select_priv| Insert_priv|
Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv |
Index_priv | Alter_priv |
+-----------+-----------------+----------+-------------+-------------+------
----------+--------------+---------------+------------+--------------+------
--------+------------+
| localhost | auth                 | wfa_user| Y             | Y
| Y                   | Y                | Y                  | Y
| Y                 | Y               | Y          |
| localhost | client_interest | wfa_user| Y             | Y                |
Y                   | Y                | Y                  | Y
| Y                 | Y               | Y          |
| localhost | clients             | wfa_user| Y             | Y
| Y                   | Y                | Y                  | Y
| Y                 | Y               | Y          |
+-----------+-----------------+----------+-------------+-------------+------
----------+--------------+---------------+------------+--------------+------
-------+------------+-
3 rows in set (0.00 sec)



mysql> select * from host where  host="localhost";
+-----------+-----------------+-------------+-----=-------+----------------+
| Host        | Db            | Select_priv | Insert_priv | Update_priv    |

+-----------+-----------------+-------------+------=------+----------------+
| localhost | client_interest | Y           | Y           | Y              |
| localhost | clients         | Y           | Y           | Y              |

+-----------+-----------------+-------------+-------------+----------------+
2 rows in set (0.00 sec)
 

mysql> select * from user where host="localhost" and user="wfa_user"; 
-----------+-----------+----------+-----------+-----------+--------------
| Host      | User     |Password
|Select_priv|Insert_priv|Update_priv|Delete_priv|Process_priv |
+-----------+----------+----------+-----------+-----------+-----------+-----
------+------------
| localhost | wfa_user | 0c5abcf0 | Y         | Y         | Y         | Y
| Y
|+----------+----------+----------+-----------+-----------+-----------+-----
------+-------------+
1 row in set (0.01 sec)

mysql> select * from tables_priv where host="localhost" and user="wfa_user"
and db="clients";
+-----------+---------+----------+---------------+-------=---------+--------
-------------+--------------+-------------+
| Host      | Db      | User     | Table_name | Grantor       | Timestamp |
Table_priv | Column_priv |
+-----------+---------+----------+---------------+--------=--------+--------
--------------
| localhost | clients | wfa_user | *          | usr223105232  | 200308310 |
Insert        |                  
| localhost | clients | wfa_user | client     | root at localhost| 200308302 |
Select        |                  |
+-----------+---------+----------+---------------+-------------------+------
---------------+-------------+-------------+
2 rows in set (0.02 sec)






More information about the thelist mailing list