Page 1 of 1

Some help with a If statement querying a DB

Posted: Tue Jul 01, 2003 6:24 pm
by dday500
hello this is my first Post so lets see how this goes i have a real problem
im just starting a new job and im taking over someone elses ugly @$$ code and Database and im trying to fix some links and Schtuff but...here is the problem...

ok...I have a mySQL db and it has a Field called Quicktime and it is empty on like 50 users and 2 users have a href in there....
i have one dynamic page that references and pulls the rest of the info like BIO and PICS but i have one button to link this href and at the moment it pulls up a Unavailable page

now im trying to change that so..

if field = href then go to href
else if
Field = null then
go to unavailable.php

i am thinking in a ASP mindset so i am confusing myself

any help on how to set up the If statement and Conditions...??

thanx

Posted: Tue Jul 01, 2003 9:03 pm
by cyril11
//first connect, and retrieve the info from the db and assign the quicktime field value to a variable

if ($quicktime){
print ("<button type="\button\" onClick=\"javascript:location='".$quicktime."';\">");
}else{
print ("<button type=\"button\" onClick=\"javascript:location='/yourpath/unavailable.php'\"");
}

Hope this help

Posted: Wed Jul 02, 2003 10:51 am
by dday500
yes thanx
This site/community and Users Kick Ass[/b]