How to get a variable from the mysql database?

Hey,

Sorry it’s me again… I want to get a variable from my mysql database… To get the username and password I used this code:

[php] $sql = mysql_query(“SELECT $mysqlname FROM $mysqltable WHERE $mysqlname=’$username’ AND $mysqlpwd=’$passwort’”);[/php]

in the same table I have the variables “votept” and “donpt” so how can I get it that for example the variable

[php]$votepoints[/php]

has the same value as in the database votept

All regards, Mark

bump, any help? :confused: shouldn’t be that hard i think so…

[php]$sql = mysql_query(“SELECT $mysqlname, votep, donp FROM $mysqltable WHERE $mysqlname=’$username’ AND $mysqlpwd=’$passwort’”);[/php]

Now you should have these two values in your result array as well.

Please consider changing from mysql_ to pdo or mysqli, the mysql_ functions are deprecated and a security risk

Sponsor our Newsletter | Privacy Policy | Terms of Service