![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Registered User
Join Date: Dec 2001
Posts: 529
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Dec 2001
Location: in front of my computer
Posts: 467
|
I have a question. Would there be a problem with using one MYSQL Database with two different scripts?
__________________
submit your sites to http://www.zap-man.com New Clean Galleries http://www.freesexpicsforyou.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
♥♥♥ Likes Hugs ♥♥♥
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
|
Quote:
__________________
I like pie. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: May 2001
Location: LV NV USA
Posts: 546
|
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
__________________
MogulPass.com Free AVS system that pays $30 per free signup, $5 per referred sale, has Promoter Sites you can just send traffic to and more. ContentLotto.com Win free content, hosting, design, traffic, lotto sites, cash and more instanty. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: May 2001
Location: LV NV USA
Posts: 546
|
![]() 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
__________________
MogulPass.com Free AVS system that pays $30 per free signup, $5 per referred sale, has Promoter Sites you can just send traffic to and more. ContentLotto.com Win free content, hosting, design, traffic, lotto sites, cash and more instanty. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Registered User
Join Date: Apr 2002
Posts: 3
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Registered User
Join Date: Apr 2002
Posts: 3
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Join Date: May 2001
Location: LV NV USA
Posts: 546
|
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
__________________
MogulPass.com Free AVS system that pays $30 per free signup, $5 per referred sale, has Promoter Sites you can just send traffic to and more. ContentLotto.com Win free content, hosting, design, traffic, lotto sites, cash and more instanty. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Apr 2002
Location: Digital Underground
Posts: 125
|
try it this way ;)
$sql = "UPDATE ".$tablename." SET points = \"".$points."\", $button = \"on\" WHERE username = \"".$username."\" "; ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Registered User
Join Date: Dec 2001
Posts: 529
|
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,. |
![]() |
![]() ![]() ![]() ![]() ![]() |