I have a very simple script set up that pulls data from a database and is output using this code:
Code: Print "<table border cellpadding=3>";
Print "<th>sku</th><th>status</th><th>name</th>";
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<td>".$info['sku'] . "</td> ";
Print "<td>".$info['status'] . "</td> ";
Print "<td>".$info['name'] . " </td></tr>";
}
Print "</table>";
However, I would like to only output rows that meet certain criteria. More specifically, I only want to show rows in which the 'status' field contains the text value "Out of stock" at any position within the field. (e.g. some fields say "Out of stock. On order.")
Any help with this will be greatly appreciated.
And here's a sample of what the table output currently looks like:
2250In stock.Product One2251In stock. On order.Product Two2252Out of stock. On order.Product Three2253Out of stock.Product Four
Call to undefined function mysql_fetch_accoc()
New to php/mysql coding. What's wrong with this sequence, or am I just not seeing to obvious?Getting, "Call to undefined function mysql_fetch_accoc()" at line n, whereline n is referring to
if statements problems
Hi. I'm trying to make a web form, but I kind of hit a dead end trying to figure out why it doesn't work. Basically, I'm trying to read from a file and then populate the form according to the file.The
How to show the difference between two data field in a database with php.
Hello php gurus,how r u all... i'm not so well facing a typical problem please help me...i'm working with php and mysql.my problem is...in a data base have two integer field like parent_id &
Hits this week counter
I have a counter on my site that tracks hits, IP's, etc. into a mySQL database. It also includes the date in the entry. The code I'm using, that's not working, to try and retrieve the amount of hits
[Need Help] php timing issues
I don't know what is going wrong. I need some help with being able to set an image at 9:00am Colorado time if my server is in California and it would be 8:00am. I tried to echo the image below, but
DOMDocument
Hello All,I need to take an XML document, modify some of the nodes in it and then perform a selective reordering of a subset of nodes. The modification I have done without too much difficulty -
Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site immediately pop-up window should open and the main page at the back should be disabled.If i click
word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wordwrap on a variable that is going to be emailed it puts the line breaks in well before it should.
Javascript or not?
How many people prefer javascript/ajax sites? How many prefer the good old fashion straight php sites?
PHP error. Need help urgently
Hi,I am programming a php site and have a problem that i just cant find out how to fix. When i run it i get this error "Parse error: syntax error, unexpected $end in