![]() |
A little question for Mysql gurus.
why is this not working?
$sql = "UPDATE $tablename SET points = \"$points\", $button = \"on\" WHERE username = \"$username\" "; note that the $button query was done in purpose because I need to update a row dinamically.. thanks. |
I have a question. Would there be a problem with using one MYSQL Database with two different scripts?
|
Quote:
|
if you are using php add this line to see problems:
print mysql_error(); also try: echo $sql; to see what exactly is being sent when you execute the query. Mogul ContentLotto.com |
As far as using 1 mysql db with multiple scripts.
You can use it with 1 million pieces of code if you have access to use the DB in the first place. Mogul ContentLotto.com |
Try it like this :
$sql = "UPDATE $tablename SET points = $points, $button = \"on\" WHERE username = \"$username\" "; I suppose the points field is numeric and the rest are strings. If so ... escape with \" only the varchar and text fields. Another usefull thing you could do is to Read The Fucking Manual :)))) www.mysql.com |
Ahhh
And another thing : you cannot do two updates in the same sql query .. do it twice : $sql = "UPDATE $tablename SET points = $points WHERE username = \"$username\" "; $sql = "UPDATE $tablename SET $button = \"on\" WHERE username = \"$username\" "; Amalia |
Quote:
You can set many things IE $sql = "Update ShittySite set name='gfy', fag='Aaron', monkeys = 34838383 where pussy = 'not present'"; Figured I would have some fun. :) Mogul ContentLotto.com Daily_Winners = Yes |
try it this way ;)
$sql = "UPDATE ".$tablename." SET points = \"".$points."\", $button = \"on\" WHERE username = \"".$username."\" "; :thumbsup |
that worked great!! thanks guys.
now please tell me where is a way to simplify this:::: how would I got about making a loop for this?? while ($row = mysql_fetch_array($result)) { $button1 = $row['button1']; $button2 = $row['button2']; $button3 = $row['button3']; $button4 = $row['button4']; $button5 = $row['button5']; $button6 = $row['button6']; $button7 = $row['button7']; $button8 = $row['button8']; $button9 = $row['button9']; $button10 = $row['button10']; $button11 = $row['button11']; $button12 = $row['button12']; $button13 = $row['button13']; $button14 = $row['button14']; } many thanks,. |
All times are GMT -7. The time now is 04:47 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123