GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   A little question for Mysql gurus. (https://gfy.com/showthread.php?t=58855)

Direktor 04-30-2002 09:21 PM

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.

ZapMan 04-30-2002 09:24 PM

I have a question. Would there be a problem with using one MYSQL Database with two different scripts?

Babaganoosh 04-30-2002 09:25 PM

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.

Mogul 04-30-2002 09:34 PM

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

Mogul 04-30-2002 09:35 PM

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

amalia32us 05-01-2002 12:38 AM

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

amalia32us 05-01-2002 12:40 AM

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

Mogul 05-01-2002 01:48 AM

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

digital 05-01-2002 05:48 AM

try it this way ;)

$sql = "UPDATE ".$tablename."
SET
points = \"".$points."\",
$button = \"on\"
WHERE username = \"".$username."\"
";


:thumbsup

Direktor 05-01-2002 09:24 AM

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