> 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 questio
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, bu
uot; <[EMAIL PROTECTED]>
Sent: Monday, June 18, 2001 4:11 PM
Subject: [PHP] INSERT problem with MySQL/PHP
> 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
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
"Todd A. Jacobs" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Monday, June 18, 2001 4:11 PM
Subject: [PHP] INSERT problem with MySQL/PHP
> PHP: 4.0.4pl1
> MySQL: 3.23.36-1
>
> I have the following code fragment, which uses the same
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.
>
; <[EMAIL PROTECTED]>
Sent: Tuesday, June 19, 2001 12:11 AM
Subject: [PHP] INSERT problem with MySQL/PHP
> 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 fr
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.
However, nothing happens with inserts; no rows are added at al
8 matches
Mail list logo