Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 11th, 2005, 04:40 AM
Authorized User
 
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default php errors

I am new in php help out please: my setup is below :

win XP pro
Apache 2.0.54
PHP 4.3.4
Mysql 3.23.49
PhpMyAdmin 2.6.2

i used the code in my php after creating my databse in PhpMyAdmin 2.6.2 but i got this error message:
(Notice: Undefined variable: metode in C:\DocRoot\updc\results.php on line 34

Notice: Undefined variable: search in C:\DocRoot\updc\results.php on line 34

Notice: Undefined variable: variable1 in C:\DocRoot\updc\results.php on line 51
No Record Found, to search again please close this window
)

Please help me out,



CODES IN PHP

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<center>
<table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000">
<tr>
<td width="60"><b>id</b></td>
<td width="100"><b>name</b></td>
<td width="70"><b>telephone</b></td>
<td width="150"><b>birthday</b></td>
</tr>
<tr>
<td>

<?

$hostname = "localhost"; // The Thinkhost DB server.
$username = "root"; // The username you created for this database.
$password = "unitysch"; // The password you created for the username.
$usertable = "details"; // The name of the table you made.
$dbName = "lopez"; // This is the name of the database you made.

MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable");
@mysql_select_db( "$dbName") or die( "Unable to select database");
?>
<?
//error message (not found message)begins
$XX = "No Record Found, to search again please close this window";
//query details table begins
$query = mysql_query("SELECT * FROM details WHERE $metode LIKE '%$search%' LIMIT 0, 50");
while ($row = @mysql_fetch_array($query))
{
$variable1=$row["id"];
$variable2=$row["name"];
$variable3=$row["telephone"];
$variable4=$row["birthday"];
//table layout for results

print ("<tr>");
print ("<td>$variable1</td>");
print ("<td>$variable2</td>");
print ("<td>$variable3</td>");
print ("<td>$variable4</td>");
print ("</tr>");
}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
?>
</table>
</center>
</body>
</html>



 
Old May 11th, 2005, 09:19 AM
Authorized User
 
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default

somone please help me out, thanks

 
Old May 16th, 2005, 05:19 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Where you assigned $metode? Or are you using it on another page, where you'ven't asigned it?






Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Login Page errors - Please Solve and Help zirconiumks Beginning PHP 2 October 5th, 2008 07:14 PM
errors in session/cookie php source? dgr72371 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 September 28th, 2007 03:32 AM
Php Installation errors kuehhc Beginning PHP 3 December 13th, 2004 12:37 PM
Can't get errors to display with <html:errors> michaeldill JSP Basics 0 August 2nd, 2004 01:47 PM
Errors Errors DB Errors Ljhopkins VS.NET 2002/2003 0 July 15th, 2003 12:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.