june_c21 Posted November 22, 2007 Share Posted November 22, 2007 what's wrong ?? $id = $_GET['id']; $query = "SELECT work_id,unit,title1,fault_rep_id,start_date,end_date,secr_recd,facilitator FROM report WHERE id=$id "; $result = mysql_query($query, $dblink); while($myrow = mysql_fetch_row($result)) { $work_id = $myrow[0]; $unit= $myrow[1]; $title1 = $myrow[2]; $fault_rep_id = $myrow[3]; $start_date= $myrow[4]; $end_date = $myrow[5]; $secr_recd=$myrow[6]; $facilitator = $myrow[7]; }Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource Link to comment https://forums.phpfreaks.com/topic/78365-error/ Share on other sites More sharing options...
rajivgonsalves Posted November 22, 2007 Share Posted November 22, 2007 please add a or die it will tell u the error $result = mysql_query($query, $dblink) or die("There was an error ".mysql_error()); Link to comment https://forums.phpfreaks.com/topic/78365-error/#findComment-396516 Share on other sites More sharing options...
kenrbnsn Posted November 22, 2007 Share Posted November 22, 2007 Change <?php $result = mysql_query($query, $dblink); ?> to <?php $result = mysql_query($query) or die("Problem with the query: $query<br>" . mysql_error()); ?> and see if an error is displayed. Ken Link to comment https://forums.phpfreaks.com/topic/78365-error/#findComment-396517 Share on other sites More sharing options...
june_c21 Posted November 22, 2007 Author Share Posted November 22, 2007 Problem with the query: SELECT work_id,unit,title1,fault_rep_id,start_date,end_date,secr_recd,facilitator FROM report WHERE id=f Unknown column 'f' in 'where clause' how come? when i check in database the id is integer Link to comment https://forums.phpfreaks.com/topic/78365-error/#findComment-396527 Share on other sites More sharing options...
rajivgonsalves Posted November 22, 2007 Share Posted November 22, 2007 the problem is with the $_GET['id'] parameter that parameter is coming as 'f' Link to comment https://forums.phpfreaks.com/topic/78365-error/#findComment-396531 Share on other sites More sharing options...
kenrbnsn Posted November 24, 2007 Share Posted November 24, 2007 If the id is indeed supposed to be an alphanumeric, then you need to quote the value in your query: <?php $query = "SELECT work_id,unit,title1,fault_rep_id,start_date,end_date,secr_recd,facilitator FROM report WHERE id='$id'"; ?> Ken Link to comment https://forums.phpfreaks.com/topic/78365-error/#findComment-398208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.