It's not displaying or pulling anything out of the database.
Code: <html>
<head>
<title>Hale's Music World: Inventory Search Results</title>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="56%" id="table1" height="129">
<tr>
<td bgcolor="#008000" colspan"3"> </td>
</tr>
<tr>
<td colspan="3">
<p align="center"><font size="5" color="#0000FF"><b>Inventory Search Results</font></td></tr>
<tr>
<td bgcolor="#008000" colspan="3"> </td>
</tr>
<tr>
<td width="33" align="center">
<font size="4" color="#008000">
<u>Artist</u></font></td>
<td width="33%" align="center">
<font size="4" color="#008000">
<u>Title</u></font></td>
<td width="33%" align="center">
<font size="4" color="#008000">
<u>Genre</u></font></td>
</tr>
<?php
$link = mysql_connect('localhost','halesuser','hales123db');
mysql_select_db("halesmusicworld", $link);
if ( isset( $_POST['Artist_Search'] ) AND $_POST['Artist_Search'] == 1 ) {
echo '1';
$artist_search = mysql_real_escape_string( $_POST["Artist_Search"] ) . '1' ;
$query = "select * from inventory where artist like '%" . $artist_search . "%'";
$result = mysql_query( "SELECT * FROM inventory", $link );
$num_rows = mysql_num_rows( $result );
echo 'Number of matching records=' . $num_rows . '<hr>';
}
if ( isset( $_POST['Title_Search'] ) AND $_POST['Title_Search'] == 2 ) {
echo '2';
$title_search = mysql_real_espace_string( $_POST["Title_Search"] ) . '2' ;
$query = "select * from inventory where title like '%" . $title_search . "%'";
$result = mysql_query( "SELECT * FROM inventory", $link );
$num_rows = mysql_num_rows( $result );
echo 'Number of matching records='. $num_rows . '<hr>';
}
if ( isset( $_POST['Genre_Search'] ) AND $_POST['Genre_Search'] == 3 ) {
echo '3';
$genre_search=$_POST ['Genre'] ;
$query= "select * from inventory where genre like '%".$genre_search."%'";
$query_results=mysql_query($query);
$match_results=mysql_num_rows($query_results);
echo 'Number of matching records='.$match_results. '<hr>';
}
echo '</tr>';
for ($i=0; $i < $match_results; $i++)
{
echo '<tr>';
$row=mysql_fetch_array($query_results);
echo '<td align="center">', ($row ['artist'] ), '</td>';
echo '<td align="center">', ($row ['title'] ), '</td>';
echo '<td align="center">', ($row ['genre'] ), '</td> </tr>';
}
?>
<tr>
<td bgcolor="#008000" colspan="3"> </td>
</tr>
</table>
<p align="center"><i>
<a href="HalesMusicWorld_Home.html">
<font face="Arial" size="5">
Return to </font></a><font face="Arial" size="5"> <a href="HalesMusicWorld_Home.html">HalesMusicWorld Home</font></i></p>
</body>
</html>
It gives me the following error message:
[/size][/font]Notice: Undefined variable: match_results in C:wampwwwinventory_search.php on line 61
I believe it has something to do with this line of code :
for ($i=0; $i < $match_results; $i++)
losing session vars when arriving from an email link
Hi,I've got a confirmation script made that sends an email with a link for a user to confirm their email. This all works pretty good with the exception of not being able to direct them to where they
Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Else statement. I've googled it several times, and looked at several sites and they all seem to
Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I don;t want people to be able to browse directly to this page. Whati s the best wasy to achieve this?
MySql timezone
Code: $sql = "SELECT *, date_format(date, '%m/%d/%Y at %I:%i %p' )as date FROM comments WHERE tutorialid='1' ORDER BY commentid DESC LIMIT $offset, $rowsperpage";Can I change the timezone
output printing as hexadecmal... XD
Everything works except the calcem call for the totusold and totuprice. The out put shows up as hex. Im not positive but i think i might have to use PBV or PBR?
ScriptResource.axd gives an error on fresh install of ASP.NET Ajax 1.0
Hello,I have a fresh install of Microsoft ASP.NET Ajax 1.0. When I create an Ajax enabled website in Visual Studio, and immediately run the Default.aspx page I get a javascript error: Sys is not
rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded in the contact us page of a website that is still on my pc only. The end goal is to place the PHP
phpMailer not working ..........
HI,I was playing with the phpMailer script and tried to send a smiple mail using their test script from my site ..... it said "send again" but i am not getting mail ..........Does anybody
Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.Some code runs as perfectly valid code, where i would like PHP to issue a warning / error.I guess this is because of the loose typing of PHP,
ctype() validation - allowing illegal characters
Hello,I use ctype() to filter and validate a user form. However, I am trying to allow certain characters.Example:Code: [Select]//Validate Copay $allow = array('$', '.'); if (!empty($copay)