homepage Welcome to WebmasterWorld Guest from 54.226.93.128
register, free tools, login, search, subscribe, 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




msg:4149570
 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




msg:4149635
 1:33 pm on Jun 9, 2010 (gmt 0)

anyone?

Matthew1980




msg:4149658
 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




msg:4150214
 4:53 am on Jun 10, 2010 (gmt 0)

Hey thanks matthew1980, everything working now :)

Matthew1980




msg:4150259
 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