New to PHP and Need some help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fzx5v0
Forum Newbie
Posts: 1
Joined: Fri Oct 17, 2008 10:26 am

New to PHP and Need some help

Post 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;
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: New to PHP and Need some help

Post by aceconcepts »

Where's your query?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: New to PHP and Need some help

Post 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.
Post Reply