Jump to content

jamjam1123

New Members
  • Posts

    3
  • Joined

  • Last visited

jamjam1123's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. When I add var_dump($cat_id); it displays "null" and I removed the suppression I get undefinded index
  2. It displays everything that should be there. Where should I start? Sorry I'm a little new at this.
  3. ////// Your Database Details here ///////// require "z_db.php"; //Your database details here //////////////////////////// Main Code sarts /////////////// @$cat_id=$_GET['cat_id']; //$cat_id=1; if(!is_numeric($cat_id)){ echo "Data Error "; <----- I'm getting the "data error" message and I'm wondering what the cause is. exit; } $message=""; if($cat_id>0){ $q=mysql_query("select subcat_id, subcat_name from plus2_subcat where cat_id=$cat_id order by subcat_name"); }else{ $q=mysql_query("select subcat_id, subcat_name from plus2_subcat order by subcat_name "); $cat_id=0; } @$message .= mysql_error(); $str= "{ \"data\" : [ "; while($nt=mysql_fetch_array($q)){ $str=$str."{\"subcat_id\" : \"$nt[subcat_id]\", \"subcat_name\" : \"$nt[subcat_name]\"},"; //$str=$str."{"myclass" : "$nt[class]"},"; } $str=substr($str,0,(strLen($str)-1)); $message=$message. " Records displayed"; $str=$str."],\"value\" : [{\"cat_id\" : $cat_id,\"message\" : \"$message\"}]}"; //echo json_encode($str); echo $str; ?> This is script I'm trying to edit and it came with a mysql dump so the database is working and is fetch some data but I'm getting this error in one of the drop down menus.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.