Help! MySQL Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

Help! MySQL Error

Post by RadixDev »

Code: Select all

mysql_query("INSERT INTO ".$prefix."_reset (uniqueid,username) VALUES('".$uniqueid."','".$_POSTї'username']."')");
For some reason this does not work
i have cheked the values for each variables there are both correct but it does not get added to the database. Tried adding to the db manually through console but won't do it... Any ideas?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

What does the below output?

Code: Select all

mysql_query("INSERT INTO ".$prefix."_reset (uniqueid,username) VALUES('".$uniqueid."','".$_POSTї'username']."')") or die(mysql_error());
RadixDev
Forum Commoner
Posts: 66
Joined: Sun Mar 14, 2004 11:27 am
Location: U.K.

Post by RadixDev »

nothing... that's the problem
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

<?php

ini_set('display_errors','1');
error_reporting(E_ALL);

$query = mysql_query("INSERT INTO ".$prefix."_reset (uniqueid,username) VALUES('".$uniqueid."','".$_POST['username']."')") or die(mysql_error());

echo $query."; rows affected: ".mysql_affected_rows()."\n";

?>
what about this then? [edit]made a slight change to force errors to show, just in case ;)[/edit]
Last edited by feyd on Sun Jun 20, 2004 3:21 am, edited 1 time in total.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Might also want to show some surrounding code, maybe it's not even getting to the query? *shrug*
Post Reply