php - Notice: Undefined offset: 4 -


i'm working on ticketing system project, there's error on code , i've search on web answer nothing works. error says

notice: undefined offset: 4 in c:\wamp\www\online bus reservation\admin\bussch.php on line 69

here code

$ddaa = mysql_query("select id, route, time bus_sch order id"); echo mysql_error(); while ($data = mysql_fetch_array($ddaa)) { $sold = mysql_fetch_array(mysql_query("select count(*) seat_details busid='".$data[0]."' , status='1'")); $available = $data[4]-$sold[0]; $rname = mysql_fetch_array(mysql_query("select routename bus_route id='".$data[1]."'")); 

the line 69 is:

$available = $data[4]-$sold[0]; 

please help. thank :)

read error message:

undefined offset: 4 

and pay attention query:

mysql_query("select id, route, time bus_sch order id"); 

you have 3 element:

  • 0 id
  • 1 route
  • 2 time

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -