php - issue with searching for string inside the array -


i hour trying understand doing wrong here. no output.

the connection ok, array full of data

<?php header('content-type: text/html; charset=utf-8');  // here's argument client. $domain = $_get['string']; $quest=$_get['quest']; $event=$_get['event'];  $con = mysql_connect('localhost', '******', '********'); if (!$con) {     die('could not connect: ' . mysql_error()); }  mysql_select_db("vocabulary", $con);  $sql="select * `0` event_name = '".$event."' , quest_id = '".$quest."'";  $result = mysql_query($sql);  $row = mysql_fetch_array($result);  $key = array_search($domain, $row);  echo $key;  mysql_close($con);   ?> 

any ideas?? thanks

a few things.

  1. you selecting table named 0. don't think should doing that.
  2. since doubt table 0 exists, guess have error @ mysql_fecth_array. try putting error_reporting(e_all); @ start of script.
  3. array_search returns false if doesn't find anything. try var_dump($key); instead.
  4. your code has serious security problem. suggest move on pdo or mysqli.

bobby tables!


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -