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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-30-2002, 09:21 PM   #1
Direktor
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.
Direktor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-30-2002, 09:24 PM   #2
ZapMan
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
ZapMan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-30-2002, 09:25 PM   #3
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Quote:
Originally posted by ZapMan
I have a question. Would there be a problem with using one MYSQL Database with two different scripts?
Nope,as long as none of the table names are the same.
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-30-2002, 09:34 PM   #4
Mogul
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.
Mogul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-30-2002, 09:35 PM   #5
Mogul
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.
Mogul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-01-2002, 12:38 AM   #6
amalia32us
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
__________________
We are selling very good content.
[email protected]
amalia32us is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-01-2002, 12:40 AM   #7
amalia32us
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
__________________
We are selling very good content.
[email protected]
amalia32us is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-01-2002, 01:48 AM   #8
Mogul
Confirmed User
 
Join Date: May 2001
Location: LV NV USA
Posts: 546
Quote:
Originally posted by amalia32us
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
Um what?

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.
Mogul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-01-2002, 05:48 AM   #9
digital
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."\"
";


digital is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-01-2002, 09:24 AM   #10
Direktor
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,.
Direktor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.