messer Posted April 16, 2009 Share Posted April 16, 2009 Please , someone to help me ... I have an <select> and this $query = mysql_query("SELECT * FROM articles ORDER BY ".addentities('ArtID').""); in my database i have 4 articles but in select menu only 3 , why so??? Link to comment https://forums.phpfreaks.com/topic/154329-solved-problems/ Share on other sites More sharing options...
soak Posted April 16, 2009 Share Posted April 16, 2009 Can you please post the code snippet that renders the select box? Link to comment https://forums.phpfreaks.com/topic/154329-solved-problems/#findComment-811357 Share on other sites More sharing options...
messer Posted April 16, 2009 Author Share Posted April 16, 2009 function meniu_select() { include('dbinfo.inc.php'); $Link = mysql_connect ("localhost", $username, $password) or die ('error'); mysql_select_db($database) or die( "Unable to select database"); $query = mysql_query("SELECT * FROM artikels ORDER BY ".addentities('ArtID').""); $row = mysql_fetch_array($query); $select = '<select name="artikels[]">'; while ($row = mysql_fetch_array($query)) { $select.= '<option value="'.addentities($row['ArtID']).'">'; $select.= ''.addentities($row['ArtNummer']).' -:- '.addentities($row['ArtDescription']).''; $select.= '</option>'; } $select.= '</select>'; return $select; Link to comment https://forums.phpfreaks.com/topic/154329-solved-problems/#findComment-811360 Share on other sites More sharing options...
messer Posted April 16, 2009 Author Share Posted April 16, 2009 In Database : ArtID int(7) No auto_increment Link to comment https://forums.phpfreaks.com/topic/154329-solved-problems/#findComment-811363 Share on other sites More sharing options...
FaT3oYCG Posted April 16, 2009 Share Posted April 16, 2009 function meniu_select() { include('dbinfo.inc.php'); $Link = mysql_connect ("localhost", $username, $password) or die ('error'); mysql_select_db($database) or die( "Unable to select database"); $query = mysql_query("SELECT * FROM artikels ORDER BY ".addentities('ArtID').""); $row = mysql_fetch_array($query); // <-- REMOVE THIS LINE $select = '<select name="artikels[]">'; while ($row = mysql_fetch_array($query)) { $select.= '<option value="'.addentities($row['ArtID']).'">'; $select.= ''.addentities($row['ArtNummer']).' -:- '.addentities($row['ArtDescription']).''; $select.= '</option>'; } $select.= '</select>'; return $select; remove the line i pointed out Link to comment https://forums.phpfreaks.com/topic/154329-solved-problems/#findComment-811367 Share on other sites More sharing options...
messer Posted April 16, 2009 Author Share Posted April 16, 2009 Thanks a lot... i'll learn it for future it works. Link to comment https://forums.phpfreaks.com/topic/154329-solved-problems/#findComment-811374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.