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
https://forums.phpfreaks.com/topic/161590-solved-sql-update-problem-please-help/
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??

Archived

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

×
×
  • 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.