Re: [PHP-DB] extracting id from db from a form field

2011-05-27 Thread Karl DeSaulniers
Good 2 hear. Pay it forward.. :) On May 27, 2011, at 4:50 PM, David McGlone wrote: On Fri, 2011-05-27 at 16:13 -0500, Karl DeSaulniers wrote: To get row 0 make the for loop change to for($i=-1; Karl, it's completely working now, I changed empty back to !isset and that did the trick. Got

Re: [PHP-DB] extracting id from db from a form field

2011-05-27 Thread Karl DeSaulniers
Actually you can keep $i as zero, it should still get row 0 now that I think of it. dont know how your table is set up so hard to tell. On May 27, 2011, at 4:31 PM, David McGlone wrote: On Fri, 2011-05-27 at 16:13 -0500, Karl DeSaulniers wrote: To get row 0 make the for loop change to f

Re: [PHP-DB] extracting id from db from a form field

2011-05-27 Thread Karl DeSaulniers
To get row 0 make the for loop change to for($i=-1; Best, Karl On May 27, 2011, at 4:08 PM, Karl DeSaulniers wrote: Hi David, Yeah sorry, that was all of the top of the head, so I apologize if anything was incorrect. I am glad you got it working though.. Best, Karl On May 27, 2011, at

Re: [PHP-DB] extracting id from db from a form field

2011-05-27 Thread Karl DeSaulniers
Hi David, Yeah sorry, that was all of the top of the head, so I apologize if anything was incorrect. I am glad you got it working though.. Best, Karl On May 27, 2011, at 3:50 PM, David McGlone wrote: On Fri, 2011-05-27 at 14:48 -0500, Karl DeSaulniers wrote: Hi David, Try this.. if(!isse

Re: [PHP-DB] extracting id from db from a form field

2011-05-27 Thread David McGlone
On Fri, 2011-05-27 at 14:48 -0500, Karl DeSaulniers wrote: > Hi David, > Try this.. > > if(!isset($_POST['ErrorCode'])) { > die('You did not enter an error code!'); > } else { > $errorcode = $_POST['ErrorCode']; > $sql = mysql_query("SELECT * FROM Sheet1 WHERE errorcode='". > $e

Re: [PHP-DB] extracting id from db from a form field

2011-05-27 Thread Karl DeSaulniers
Oh I forgot.. ... WHERE errorcode='".mysql_real_escape_string($errorcode)."'); Best, Karl On May 27, 2011, at 2:48 PM, Karl DeSaulniers wrote: Hi David, Try this.. if(!isset($_POST['ErrorCode'])) { die('You did not enter an error code!'); } else { $errorcode = $_POST['ErrorC

Re: [PHP-DB] extracting id from db from a form field

2011-05-27 Thread Karl DeSaulniers
Hi David, Try this.. if(!isset($_POST['ErrorCode'])) { die('You did not enter an error code!'); } else { $errorcode = $_POST['ErrorCode']; $sql = mysql_query("SELECT * FROM Sheet1 WHERE errorcode='". $errorcode."' "); if($sql && mysql_numrows($sql) > 0) {

[PHP-DB] extracting id from db from a form field

2011-05-27 Thread David McGlone
Hello everyone, I need a little help. I've never tried to extract from a db in the manner I'm trying. It's pretty simple and straightforward I believe, but for some reason I can't figure out how. What I have is a form with 1 simple field, and this field takes the ID of the row I want returned. H