replace $result = mysql_db_query('item_db', $sql_query, $connection_id);
with $result = mysql_db_query('item_db', $sql, $connection_id); or just
mysql_query($sql);
- Original Message -
From: Todd A. Jacobs [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Monday, June 18, 2001
On Mon, 18 Jun 2001, Todd A. Jacobs wrote:
$sql = INSERT INTO question VALUES (NULL, $user_idx, $objective,
'$question', '$question_type', NULL, NULL);
$result = mysql_db_query('item_db', $sql_query, $connection_id);
Thanks to all who answered. It was a simple mistake, but
Can anyone tell me what might be wrong?
$user_idx = 1;
$objective = 1;
$question = 'Foo';
$question_type = 'singular';
$connection_id = mysql_connect ('192.168.1.1', 'php', 'password')
or die (No connection.\n);
$sql = INSERT INTO question VALUES
Only a small little problem.. you called your sql query $sql and then in
your mysql_db_query line called it $sql_query..call them both the same name
and it should work!
HTH,Tom
- Original Message -
From: Todd A. Jacobs [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Tuesday,
On Tue, 19 Jun 2001 08:41, Todd A. Jacobs wrote:
PHP: 4.0.4pl1
MySQL: 3.23.36-1
I have the following code fragment, which uses the same connection
parameters elsewhere to *successfully* to retrieve data from a
database, so this doesn't appear to be a permissions problem with
MySQL.
Try the following,
INSERT INTO questions(user_id,objective,question,question_type)
VALUES('$uawr_idx', '$objective', '$question', '$question_type')
Define the rows you want to insert into.
Hope this helps!
Regards,
Ray
- Original Message -
From: Todd A. Jacobs [EMAIL PROTECTED]
To:
Todd,
Did you echo $sql and examine it?
Did you try the statement at the mysql console?
Does the list of values exactly match the field list?
Did you try the alternate syntax
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name
SET col_name=expression, col_name=expression, ...
as in the
7 matches
Mail list logo