process form & mysql
Posted: Thu Aug 24, 2006 12:10 pm
feyd | Please use
and this is the search.php ...[/syntax]
My problem is that this code is not working ... when the php "runs" just appear a blank web page
...
thanks in advance .
greetings.

feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, i`m having trouble with this stuff .. i need to retrieve data from a record that match the search field.
this is the "part" where the user look for information ...
[syntax="html"]<html>
<body>
<form action=search.php method=GET>
please fill search data:
<p>
Nombre: <input type=text name=name size=25 maxlength=25>
<p>
<input type=submit>
</form>
</body>
</html>Code: Select all
<html>
<body>
<?php
mysql_pconnect("localhost","myuser","mypassword");
mysql_select_db("mydatabase");
if ($name == "")
{$name = '%';}
$result = mysql_query ("SELECT * FROM mytablename WHERE nombre LIKE '$name%'");
if ($row = mysql_fetch_array($result))
{
do {
print $row["name"];
print (" ");
print ("<p>");
print $row["fiel2"];
print ("<p>");
print $row["field3"];
print ("<p>");
} while($row = mysql_fetch_array($result));
}
else {print "No records where found !";}
?>
</body>
</html>thanks in advance .
greetings.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]