K here's my problem.
The php code you see below is a new window that will display the "Materials" from the database. The $invoice that you see is getting the invoice number from the previous screen and searching for the record number with that invoice number in it. Basically, it is a record finder using the invoice number as the search term, and displaying the rest of that specific record on the new window.
i need to somehow make it so it will say "Materials: " and then the actual materials in the database ($materials?).
Then if there isn't any materials in the database ($materials = NULL), it will display "No materials found".
Can someone please tell me how to do this? If you need more information just let me know.
10 pts to the best answer!!
<?php
mysql_connect("@@", "@@", "@@") or die(mysql_error()) ;
mysql_select_db("@@") or die(mysql_error()) ;
$data = mysql_query("SELECT * FROM main ORDER BY date DESC")
or die(mysql_error());
$invoice=mysql_real_escape_string($_PO...
$result=mysql_query("SELECT * FROM main WHERE Invoice LIKE '$invoice' ");
if ($result != NULL) {
goodMat();
}
if ($invoice = NULL) {
echo "No materials found!";
}
function goodMat() {
if ($row != NULL) {
While ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$materials=mysql_real_escape_string($_PO...
echo "Materials: " . $materials;
}
}
}
?>
Tags: