Some help with a If statement querying a DB

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
dday500
Forum Newbie
Posts: 2
Joined: Tue Jul 01, 2003 6:24 pm
Location: AZ

Some help with a If statement querying a DB

Post 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
cyril11
Forum Newbie
Posts: 4
Joined: Tue Jul 01, 2003 4:59 pm

Post 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
dday500
Forum Newbie
Posts: 2
Joined: Tue Jul 01, 2003 6:24 pm
Location: AZ

Post by dday500 »

yes thanx
This site/community and Users Kick Ass[/b]
Post Reply