Hi
I have this code and I would like to put an if statement in it to look up a value in a database field in mysql and if the value is greater or equal to 7.99 display free shipping else display free shipping on order over 7.99
I tried this but it is well wrong it dod not get the info from the database the table is called products and the row id product_price. I am not sure how to do this. i would be greatfull if someone can point me in the right direction
$lc_text.= "<br>" . $sample = products_price;
IF ($sample > 7.99) {
print "Free Shipping";
}
ELSE {
print "Order over £7.99 gets free shipping";
break;
New to PHP and Need some help
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: New to PHP and Need some help
Where's your query?
Re: New to PHP and Need some help
Sounds like you need to learn the basics of database usage with PHP. Try this: http://www.freewebmasterhelp.com/tutorials/phpmysql and http://www.php-mysql-tutorial.com/conne ... ng-php.php and http://blazonry.com/scripting/linksdb/start.php. You will have a fair amount of code to write to do what you describe, not just assign a variable.