Niet inserten?
Gamezhoek - 04/04/2006 19:21
HTML interesse
Kan iemand mij vertellenw arom dit niet werkt?
$verzenden = mysql_query("INSERT INTO pm(subject, message, user_to, user_from, read, time) VALUES($subject, $bericht, $user_to, $user_from, '0', NOW())");
$verzenden = mysql_query ( "INSERT INTO pm(subject, message, user_to, user_from, read, time) VALUES($subject , $bericht , $user_to , $user_from , '0', NOW())" ) ;
Ik snap er echt ff niks meer van... Want het hoort gewoon te werken, toch?
8 antwoorden
Gesponsorde links
ikkedikke - 04/04/2006 19:22
PHP expert
variabelen buiten quotes halen, krijg je een error?
Gamezhoek - 04/04/2006 19:24
HTML interesse
Geen error, en, variabelen staan ook buiten quotes... behalve die 0, wnt dat is een string.
timo - 04/04/2006 19:25
PHP ver gevorderde
je moet altijd de waardes wel tussen '' zetten... en zet er nog eens 8er: or die(mysql_error());
Gamezhoek - 04/04/2006 19:31
HTML interesse
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read, time) VALUES(Onderwerp, Bericht, Gamezhoek, Gamezhoek, '0', NOW())' at line 1
Deze error...
marten - 04/04/2006 19:37 (laatste wijziging 04/04/2006 19:40)
Beheerder
<?php
'" . $verzenden = mysql_query("
INSERT INTO pm
(subject,
message,
user_to,
user_from,
read,
time)
VALUES('" . $subject . "'.
'" . $bericht . "',
'" . $user_to . "',
'" . $user_from . "',
'0',
'NOW()'
)")
OR die(mysql_error());
?>
<?php
'" . $verzenden = mysql_query("
INSERT INTO pm
(subject,
message,
user_to,
user_from,
read,
time)
VALUES(' " . $subject . " '.
' " . $bericht . " ',
' " . $user_to . " ',
' " . $user_from . " ',
' 0 ',
' NOW( ) '
)")
OR die(mysql_error());
?>
Gamezhoek - 04/04/2006 19:43
HTML interesse
Dan krijg ik, als ik er or die(mysql_error()); achter zet, deze error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read, time) VALUES('Onderwerp'. 'Bericht', 'Gamezhoek', 'Gamezhoek', '0', 'NOW()' at line 1
marten - 04/04/2006 19:44
Beheerder
<?php
$verzenden = mysql_query("
INSERT INTO pm
(subject,
message,
user_to,
user_from,
read,
time)
VALUES('" . $subject . "'.
'" . $bericht . "',
'" . $user_to . "',
'" . $user_from . "',
'0',
'NOW()'
)")
OR die(mysql_error());
?>
<?php
INSERT INTO pm
(subject,
message,
user_to,
user_from,
read,
time)
VALUES('" . $subject . "'.
'" . $bericht . "',
'" . $user_to . "',
'" . $user_from . "',
'0',
'NOW()'
)" )
?>
mijn foutje stond nog wat verkeerds voor $verzenden
Gesponsorde links
Dit onderwerp is gesloten .