datoshway Posted March 30, 2010 Share Posted March 30, 2010 I need to modify this code i'm working with so im pulling a certain row and not the whole table. Can anyone help? <?php define("STR_RELATIVE_PATH", ""); require STR_RELATIVE_PATH . "_includes/_database.php"; db_connect(); db_select(); $strQuery = "SELECT * FROM tblServices ORDER BY intID ASC"; $queryGetServices = db_query($strQuery); ?> Quote Link to comment https://forums.phpfreaks.com/topic/197037-modify-select-from/ Share on other sites More sharing options...
Maq Posted March 30, 2010 Share Posted March 30, 2010 Where is this 'certain row' coming from...? Regardless, you're going to most need to use a WHERE clause. Quote Link to comment https://forums.phpfreaks.com/topic/197037-modify-select-from/#findComment-1034363 Share on other sites More sharing options...
greatstar00 Posted March 30, 2010 Share Posted March 30, 2010 add where cause after "tableServices" Quote Link to comment https://forums.phpfreaks.com/topic/197037-modify-select-from/#findComment-1034364 Share on other sites More sharing options...
jcbones Posted March 30, 2010 Share Posted March 30, 2010 <?php define("STR_RELATIVE_PATH", ""); require STR_RELATIVE_PATH . "_includes/_database.php"; db_connect(); db_select(); $strQuery //Rename column to the column you are searching, and the value is self explanatory. = "SELECT * FROM `tblServices` WHERE `column` = 'value'"; //You don't need an ORDER BY if you are only pulling one row. $queryGetServices = db_query($strQuery); ?> Quote Link to comment https://forums.phpfreaks.com/topic/197037-modify-select-from/#findComment-1034369 Share on other sites More sharing options...
datoshway Posted March 30, 2010 Author Share Posted March 30, 2010 You rock man, thank you for the help, worked perfectly! <?php define("STR_RELATIVE_PATH", ""); require STR_RELATIVE_PATH . "_includes/_database.php"; db_connect(); db_select(); $strQuery //Rename column to the column you are searching, and the value is self explanatory. = "SELECT * FROM `tblServices` WHERE `column` = 'value'"; //You don't need an ORDER BY if you are only pulling one row. $queryGetServices = db_query($strQuery); ?> Quote Link to comment https://forums.phpfreaks.com/topic/197037-modify-select-from/#findComment-1034371 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.