Jump to content

[SOLVED] Sql update problem PLEASE HELP


Paldo

Recommended Posts

Hi guys!

Somebody please have a look at this. It was working once two weaks ago and now evening before I need it, it's printing an error.

It says : 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 '' at line 2

Well I don't know what it mean with the 2 line couse it's pretty far from any SQL code...

Thanks for any help

<html>
<body>

<div style='position:absolute;left:10%; right:10%;  top:0%;  z-index: 0'> <img src='backround.jpg' width="800" height="800">   
<div style="position: absolute; left: 1px; top: 1px"> <img src='banner.png'>
</div>

<?php
$balance = $_GET['t'];
echo  $balance;
$accountID = $_GET['c'];
echo $accountID;
echo $_POST[prevod];
echo'<a href="http://parobek.euweb.cz/welcome.php? c='.$accountID.'">Navrat</a>';

$con = mysql_connect("mysql.webzdarma.cz","parobek","adnddnd");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("parobek", $con);

if ( $balance > $_POST[prevod] )
{
mysql_query("UPDATE Zakaznici SET stav= stav + $_POST[prevod]
WHERE cisuctu= $_POST[cisuctu] ") or die(mysql_error()) ;

mysql_query("UPDATE Zakaznici SET stav= stav - $_POST[prevod]
WHERE cisuctu= $accountID ") or die(mysql_error()) ;

mysql_close($con);
}
else {
echo '<div style="position: absolute; left: 210px; top: 420px">';
echo "Tolko nemas na ucte";
echo '</div>';

echo '<div style="position: absolute; left: 210px; top: 460px">';
echo'<a href="http://parobek.euweb.cz/transfer.php?t='.$balance.' & c='.$accountID.'"><img border="0" img src="spat.png"></a>';
echo '</div>';
}
?>

</body>
</html>


Link to comment
Share on other sites

<html>
<body>

<div style='position:absolute;left:10%; right:10%;  top:0%;  z-index: 0'> <img src='backround.jpg' width="800" height="800">   
<div style="position: absolute; left: 1px; top: 1px"> <img src='banner.png'>
</div>

<?php
$balance = $_GET['t'];
echo  $balance;
$accountID = $_GET['c'];
echo $accountID;
echo $_POST[prevod];
echo'<a href="http://parobek.euweb.cz/welcome.php? c='.$accountID.'">Navrat</a>';

$con = mysql_connect("mysql.webzdarma.cz","parobek","adnddnd");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("parobek", $con);

if ( $balance > $_POST[prevod] )
{
mysql_query("UPDATE `Zakaznici` SET `stav`= 'stav' + '$_POST[prevod]'
WHERE `cisuctu` = '$_POST[cisuctu]' ") or die(mysql_error()) ;

mysql_query("UPDATE `Zakaznici` SET `stav`= 'stav' - '$_POST[prevod]'
WHERE `cisuctu`= '$accountID' ") or die(mysql_error()) ;

mysql_close($con);
}
else {
echo '<div style="position: absolute; left: 210px; top: 420px">';
echo "Tolko nemas na ucte";
echo '</div>';

echo '<div style="position: absolute; left: 210px; top: 460px">';
echo'<a href="http://parobek.euweb.cz/transfer.php?t='.$balance.' & c='.$accountID.'"><img border="0" img src="spat.png"></a>';
echo '</div>';
}
?>

</body>
</html>


 

i've added `` and '' to your query , any difference??

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.