Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Problems with my script

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Problems with my script

Postby HaVoC » Mon Dec 01, 2003 1:45 pm

Code: Select all
$sql = mysql_query("SELECT * FROM members WHERE rank='$rank'")
$row = mysql_fetch_array($sql)
if ($rank == 1) {
echo "Leaders";
print $row['name'];

Error on line 4...I've been stuck on this for about 1 day. Someone please help me!
New php-forum User
New php-forum User
Posts: 35
Joined: Thu Nov 27, 2003 6:22 am

Postby swirlee » Mon Dec 01, 2003 2:43 pm

You're missing the semicolon at the end of this line:

Code: Select all
$row = mysql_fetch_array($sql)

And for future reference, next time tell us what error you're getting, as "I'm getting errors" isn't very informative.
User avatar
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Skeletor » Mon Dec 01, 2003 3:35 pm

Also make sure you close your {} after your if statement. I imagine you have additional code below what you posted, but that may lead to errors like the one you received.
New php-forum User
New php-forum User
Posts: 147
Joined: Tue Nov 19, 2002 7:47 am
Location: US, Ohio

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.