Jump to content


This topic is now archived and is closed to further replies.


What am I doing wrong here?

Recommended Posts


I am getting an error when I try to run this query:
[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Chnage your account on dsfdsfsfsfs Game</title>
<style type="text/css">
body {
    background-color: #CCCCCC;
.style1 {font-family: Tahoma}

// Get the 'username' varible from flash
$username = $_POST['username'];
$password = $_POST['password'];
$clueone = $_POST['clueone'];
$cluetwo = $_POST['cluetwo'];
$cluethree = $_POST['cluethree'];

$dbcnx = @mysql_connect("localhost","fdsfdsfs","dsfsfsfs");
if (!$dbcnx) {
echo "<p>Unable to connect to the database server at this time.</p>";
$result = @mysql_query("UPDATE whoamipeople SET Clue = '$clueone', Cluetwo = '$cluetwo', Cluethree = '$cluethree' WHERE Username = '$username', Password = '$password'");
if (!$result) {
exit("<p>Error performing query: " . mysql_error() . "</p>");
<p><a href="http://dsfsfsfsfs" class="style1">Click here to login </a></p>

This error is what I get:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Error performing query: 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 ' Password = ''' at line 1[/quote]

What am i'm doing wrong?

Mysql version = 4.1.14-standard

Share this post

Link to post
Share on other sites
WHERE Username = '$username' [b]AND[/b] Password = '$password'");

Share this post

Link to post
Share on other sites
I would recommend you to put back ticks around the word Password in your mysql query as password a predefined function in mysql and so m ysql is getting confused so if you add back ticks around it then your query should pass through:
[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][color=green]WHERE[/color] Username[color=orange]=[/color][color=red]'$username'[/color] [color=blue]AND[/color] `Password`[color=orange]=[/color][color=red]'$password'[/color]" [!--sql2--][/div][!--sql3--]

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.