hi i was wondering where in my script there's an error.
foobar.html
foobar.phpCode:<html> <head> <title> </title> </head> <body> <form name="search" method="get" action="foobar.php?action=humbug"> Search</br>------</br> <label for="title_search">Title</label></br> <input id="title_search" name="title_search" type="text"></br></br> <input type="submit" value="Search!"> </form> </body> </html>
if i make the action to foobar.php AND write the php script not as a function it works. what am i doing wrong?Code:<?php function humbug(){ mysql_connect("","","") or die(mysql_error()); mysql_select_db("") or die(mysql_error()); $title_search=$_GET["title_search"]; $result=mysql_query("SELECT * FROM ml WHERE title LIKE '%$title_search%'"); while($rowresult=mysql_fetch_array($result)){ echo "<tr><td class='title'>"; echo $rowresult['title']; echo "</td><td class='year'>"; echo $rowresult['year']; echo "</td><td class='view'>"; echo $rowresult['1st'];}} ?>


Reply With Quote
Bookmarks