Computer Science Canada

Unknown database problem

Author:  Homer_simpson [ Tue Aug 05, 2003 1:33 am ]
Post subject:  Unknown database problem

this is my command
code:


<?
include 'mysqlfunctions.php';
$link=connectmysql();
mysql_select_db("backstabbers");

$query="UPDATE userinfo SET ps='$passid' WHERE id='$id'";
$result = MySQL_query ($query,$link);

?>



I get no error or warning but the thing just doesn't work...!!! Crying or Very sad

Author:  Amailer [ Tue Aug 05, 2003 1:44 am ]
Post subject: 

Could you post the connectmysql function
(all passwords taken out and replaces with PASSWORD Very Happy)

Damm mac can't do anything on it!

EDIT:
k try this... hmm

code:

<?
include 'mysqlfunctions.php';  //I think this is the file name hmm...

$link = connectmysql();

mysql_select_db("backstabbers" ,$link);

$result = mysql_query("UPDATE userinfo ". "SET pas='$passid' . "WHERE id='$id'");

?>


if i did not make any mistakes -.- it should be right Very Happy

Author:  PaddyLong [ Tue Aug 05, 2003 1:07 pm ]
Post subject: 

I think that
$result = mysql_query("UPDATE userinfo ". "SET pas='$passid' . "WHERE id='$id'");

should be more like

$result = mysql_query("UPDATE userinfo SET pas=".$passid." WHERE id=".$id);

you had your .'s in places where they shouldn't be and stuff ...

Author:  Amailer [ Tue Aug 05, 2003 1:17 pm ]
Post subject: 

Hmm...
It don't matter...

The . is just to seperate the stuff,
cuz i just find it better that way Very Happy

IDK thats how i started off Confused
Still works Very Happy

Author:  Homer_simpson [ Tue Aug 05, 2003 1:29 pm ]
Post subject: 

well that connectmysqlf function works properly i'm sure of it cuz i use it in everyfile... and i didn't need to use any . when i wanted to insert to mysql... this is one of those errors that's gonna take me sometime to figure out Crying or Very sad

Author:  Amailer [ Tue Aug 05, 2003 1:31 pm ]
Post subject: 

Wait it did nto get solved?
Hmmm
whats the error?

Author:  PaddyLong [ Tue Aug 05, 2003 2:27 pm ]
Post subject: 

the . is used to attach two strings ... like in turing you do like
someString := string1 + " " + string2
in PHP it's
$someString = $string1 . " " . $string2

Author:  Amailer [ Tue Aug 05, 2003 2:42 pm ]
Post subject: 

Ya,
But still i like it that way...thats how i learned it Very Happy

Author:  Homer_simpson [ Fri Aug 08, 2003 4:08 pm ]
Post subject: 

btw i got it working using connectiong separate strings using . stupid php Razz

Author:  Amailer [ Fri Aug 08, 2003 5:13 pm ]
Post subject: 

Homer_simpson wrote:
stupid php Razz


PhP is not stupid...

its just the programmer...who makes his script stupid Very Happy

Author:  Homer_simpson [ Fri Aug 08, 2003 7:06 pm ]
Post subject: 

ah... so that's y people sayi'm stupid...TY Laughing

Author:  Amailer [ Fri Aug 08, 2003 7:45 pm ]
Post subject: 

hmm....ya.....


: