homepage Welcome to WebmasterWorld Guest from 54.197.183.230
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Form Row ID
form method post
chrissim

5+ Year Member



 
Msg#: 4149568 posted 12:26 pm on Jun 9, 2010 (gmt 0)

hi,

i'm unable to retrieve value of row id when clicking the submit button. The id was completely empty.
Could some one brief me on these issue?
Thanks



while($row = mysql_fetch_row ($result))
{
echo "<tr>";

// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td class='td_rowhd'><font class=tdrow>$cell</font></td>";

echo "<td class='td_rowhd'><form method='POST' action='update.php?id=".$row['id'] . "'>
<input type='submit' value='Update Changes'></td>";


 

chrissim

5+ Year Member



 
Msg#: 4149568 posted 1:33 pm on Jun 9, 2010 (gmt 0)

anyone?

Matthew1980

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4149568 posted 2:12 pm on Jun 9, 2010 (gmt 0)

Hi there Chrissim,

I am curios as to why you are looping within a loop..

What are you trying to achieve? Because it looks like you want to grab data, edit, then update records according to the id number pulled in the first place...

First place to start is by turning on error_reporting to see what if any errors are being flagged:-

<?php
error_reporting(E_ALL);
//rest of code
.
.

then trace each step as you get the data by echoing and exiting :)

Cheers,
MRb

chrissim

5+ Year Member



 
Msg#: 4149568 posted 4:53 am on Jun 10, 2010 (gmt 0)

Hey thanks matthew1980, everything working now :)

Matthew1980

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4149568 posted 7:10 am on Jun 10, 2010 (gmt 0)

Hi there chrissim,

What'd I do? I assume there was a typo in the mix somewhere?

Cheers,
MRb

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved