Jump to content

quick query


grlayouts

Recommended Posts

what have a missed its not runing all the queries.

 


$txsql = "UPDATE players set cashaccount=cashaccount+5, UPDATE players set rank=Donator where user='$_POST[item_name]', insert into log (owner,log) values(1,'<b>$_POST[item_name] Has just bought upgrade 1</b>')";
$resultat_txsql = mysql_query($txsql);

Link to comment
https://forums.phpfreaks.com/topic/71509-quick-query/
Share on other sites

<?php

$txsql = "UPDATE players set cashaccount=cashaccount+5, rank='Donator where user='$_POST[item_name]'";
$txsql2 = "insert into log (owner,log) values(1,'$_POST[item_name] Has just bought upgrade 1')";
$resultat_txsql = mysql_query($txsql) or die('Error updating players: '.mysql_error());
$resultat_txsql2 = mysql_query($txsql2) or die('Error inserting logs: '.mysql_error());

?>

 

That should/may work but if your doing an update you need a WHERE player = '$_POST[player]' This toptaly depends on your table. what columns have you got in your table? You seem to be totaly confused about SQL so you may need to have a look at SQL tutorials.

 

 

Liam

Link to comment
https://forums.phpfreaks.com/topic/71509-quick-query/#findComment-359981
Share on other sites

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.