Your query probably fails, try debugging:
[php]
$result = mysql_query ($query) or die(mysql_error());
[/php]
I have the same problem and I check all the things and precautions. My code is ok. But I dont know what is the problem. My battery is gone down and I just want to post it to get answers when I came again. So please help I also debug it, and that's ok. Help it mess up my time.
Thanks
chand.
Junior Poster in Training
57 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
I have the same problem and I check all the things and precautions. My code is ok. But I dont know what is the problem. My battery is gone down and I just want to post it to get answers when I came again. So please help I also debug it, and that's ok. Help it mess up my time.
Thanks
Read the FAQ dealing with this problem instead of reviving 2 year old threads.
ShawnCplus
Code Monkey
1,583 posts since Apr 2005
Reputation Points: 526
Solved Threads: 268
Chand, your code is obviously NOT ok. :-) Please paste your code in this or another thread for us to review.
//index.php
<! DOCTYPE HTML PUBLIC "W3C//DTD// HTML 4.01//TRANSITIONAL//EN">
<HTML>
<HEAD>
<TITLE>Wish to visualize!</TITLE>
</HEAD>
<BODY>
<form action="wishlist.php" method="GET" name="wishList">
Show wish list of: <input type="text" name="user"/>
<input type="submit" value="Go" />
</form>
<?php
?>
</BODY>
</HTML>
//wishlist.php
<! DOCTYPE HTML PUBLIC "W3C//DTD// HTML 4.01//TRANSITIONAL//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Wish List of <?php echo $_GET["user"]."<br/>";?>
<?php
$con = mysql_connect("localhost", "root", "");
if(!$con){
die('Could not connect!' .mysql_error());
}else{
echo("connected!");
}
mysql_query("SET NAMES 'utf8'");
if(mysql_select_db("wishlist", $con)){
echo("DB is selected.<del>");
}
$wisher = mysql_query("SELECT id FROM wishes WHERE description = '".mysql_real_escape_string($_GET["user"])."'");
if(!($wisher)){
die(mysql_error());
}
if(mysql_num_rows(($wisher)<1)){
die("The specified person".$_GET["user"]. "is not exist here");
}
$wisherId = mysql_result($wisher, 0);
?>
</body>
</html>
chand.
Junior Poster in Training
57 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
Thank you so much for your help. I'm very grateful to you. I'm a novice could you tell me about good learning resources for php.
Thanks
chand.
Junior Poster in Training
57 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0