Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 14th, 2006, 08:49 PM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Undefined variable

while ($row = mysql_fetch_array($result)){
    $Part_Number= $row['Part_Number'];
  $Mask_Set= $row['Mask_Set'];
  $Released_Product = $row['Released_Product'];
  $display_block .= "

    <tr><td><a href='sDetails_byid.php?Part_Number=$Part_Number'> $Part_Number</a></td><td>$Released_Product</td><td>$Mask_Set</td>
    </tr>";

the error mistake is "Undefined variable: display_block in c:\easyphp1-8\easyphp1-8\www\staff_id.php on line 38"

i am a beginner hope to get solution here thanks

Reply With Quote
  #2 (permalink)  
Old October 31st, 2006, 05:07 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey adel_88,

Can you post all of your code ? (especially lines 37-39!)

Cheers

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote
  #3 (permalink)  
Old July 9th, 2007, 03:21 PM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

$display_block is followed by .=
The period means that the value in the variable will be appended. In the while loop the parser generates an error since the variable has not yet been assigned. On my machine the code still worked as it should.
To get rid of the error message assign the variable a null text string value before the loop.

$display_block = ""
while ($row = mysql_fetch_array($result)) {

Namaste,

Kevin Tough

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined Variable aspire Beginning PHP 4 July 12th, 2006 07:00 AM
Undefined variable najib Beginning PHP 4 July 1st, 2005 08:12 AM
undefined variable !! cody44 Beginning PHP 3 January 20th, 2005 04:47 PM
Undefined Variable fpolan Beginning PHP 9 July 15th, 2004 06:24 AM
Undefined Variable Some Help! knight Beginning PHP 7 February 19th, 2004 06:07 AM



All times are GMT -4. The time now is 08:08 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.