NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page having a undifine index id error help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Reply
 
LinkBack Thread Tools
Old 06-28-2009, 10:30 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jun 2009
Posts: 2
co.ador is an unknown quantity at this point
 



having a undifine index id error help


Notice: Undefined index: id in C:\wamp\www\shoes\menu2prueba.php on line 148

I am getting this error can any body help

PHP Code:
$query "SELECT * FROM menu WHERE id IN ( 1, 2, 3, 4)";  

// execute query 
$result mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 

// see if any rows were returned 
if (mysql_num_rows($result) > 0) { 
    
// yes 
    // print them one after another 
   
echo '<table  class="felo">'
????: NamePros.com http://www.namepros.com/programming/593118-having-undifine-index-id-error-help.html
????: NamePros.com http://www.namepros.com/showthread.php?t=593118
   echo 
"<tr>";
echo
'<td width="800" height="100%" bgcolor="#FFFFFF" class="quelo">'

while(
$row3 mysql_fetch_row($result)) { 
echo 
'
<table class="trelo" >
 <tr>
 <td width="152" rowspan="2" class="cebo">
  <h3 align="center"><a href="itemdetails.php?id='
,$row3['id'],'"> ',$row3[3],'</a> </h3><p> //  line 148
<a href="itemdetails.php?id[]=1&id[]=2&id[]=3&id[]=4"><img src="'
,$row3[0],'" width="140" height="160" alt="product" style=" border-color:#FF6600; border:thin; border-style:solid;"/></a></p></td>
                  <td class="pricegif"><img src="../../../Users/joe/AppData/Local/images/price.gif" alt="we" width="53" height="21" hspace="10" align="middle" /></td>
                  <td class="price"><a href="#">$'
,$row3[4],'</a></td>

echo "</td>";
echo"</tr>";
echo"</table>"; 
co.ador is offline   Reply With Quote
Old 06-29-2009, 06:02 PM   #2 (permalink)
NamePros Member
Join Date: Sep 2006
Posts: 99
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
 



That's not an error, it's a notice. It basically means there's something in your code that isn't perfect.
"Undefined Index" means that in one of your mysql results, there is a lack of the 'id' row.

You can stop this from being reported in php.ini or using PHP: error_reporting - Manual


Bruce
Bruce_KD is offline   Reply With Quote
Old 06-30-2009, 11:29 AM   #3 (permalink)
NamePros Regular
 
qbert220's Avatar
Join Date: Jul 2007
Location: UK
Posts: 395
qbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to behold
 


Protect Our Planet
mysql_fetch_row returns an array with numerical keys (so $row3['id'] will never be defined). You might want to use mysql_fetch_array instead. This returns an array with numerical and MySQL column names by default.
qbert220 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
List 200+ free web directories Stoun Free Resources 7 09-06-2009 11:20 AM
Nikkei225.com on Ebay (1 day left) - The Japan Stock Index Average Infinity Domains For Sale - External Auctions 0 01-19-2007 03:18 AM
Software Index script ($1 for NP members) coolguyz Scripts For Sale 0 08-23-2006 02:45 PM
#1 Rated Link Script on CGI Resource Index! Ferman Scripts For Sale 3 01-18-2006 02:28 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 12:07 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger