easyphp notice appear...
![]() ![]() ![]() ![]() ![]() |
easyphp notice appear...
|
|
Nov 13 2009, 06:57 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#1
|
|
Newbie ![]() Group: Junior Member Posts: 23 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Jan 2003 From: selangor |
Notice: Undefined index: name in c:\program files\easyphp1-8\www\testing\actionsearch3.php on line 9
testing CODE <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dbtables", $con); $result = mysql_query("SELECT * FROM users WHERE name='$_POST[name]'"); while($row = mysql_fetch_array($result)) { echo "testing"; } mysql_close($con); ?> why this coding got notice appear when i'm using easyphp..... if i use xampp this notice not appear......but i'm built my project use easy php....can't used xampp... anyone help me to fix that notice........ |
|
|
Nov 13 2009, 07:00 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#2
|
|
Getting Started ![]() ![]() Group: Junior Member Posts: 255 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Jun 2007 From: Penang |
type this at the top of ur script
CODE error_reporting(E_ALL ^ E_NOTICE); |
|
|
Nov 13 2009, 09:36 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#3
|
|
Casual ![]() ![]() ![]() Group: Junior Member Posts: 377 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Oct 2004 |
CODE <?php if(!empty($_POST){ // post check $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dbtables", $con); $result = mysql_query("SELECT * FROM users WHERE name='$_POST[name]'"); while($row = mysql_fetch_array($result)) { echo "testing"; } mysql_close($con); } // post check ?> do a $_POST check |
![]() ![]() ![]() ![]() |
| Lo-Fi Version | Time is now: 22nd March 2010 - 03:03 AM |