Page 1 of 1

New to PHP and Need some help

Posted: Fri Oct 17, 2008 10:41 am
by fzx5v0
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;

Re: New to PHP and Need some help

Posted: Fri Oct 17, 2008 11:14 am
by aceconcepts
Where's your query?

Re: New to PHP and Need some help

Posted: Fri Oct 17, 2008 5:00 pm
by califdon
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.