Hello, i am trying to select 8 specific rows from my db that pertain to my billing management software. what i wanna do is dynamically updat the pricing on the order page by only have to do it threough the billing software.
I managed to get one working, but its long and im sure theres a simpler solution just not sure.
function showprices(){
include "config.php";
unset($db,$table);
$db='xxxxxxxxxx';
$table='xxxxxxxx';
$connection = mysql_connect($host, $uname, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$query = "SELECT * FROM `$table` ORDER BY pack_id ASC LIMIT 4, 8";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_row($result);
$row =$row[2];
$row = explode('|0|0|0|0',$row);
echo $row[0];
}
as you can tell, $row[0] is the price i want, but i have 7 more to like this, and what happens in the future if i add more plans. then the ids will get messed up. the ids right now are not incremental so im pretty much stuck 😕
Thanks for any help