Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   problems with my Autosuggest project (http://www.go4expert.com/forums/autosuggest-project-t16032/)

guif 2Feb2009 23:14

problems with my Autosuggest project
I have problems with my Autosuggest project.

I don't know to detect which is the value that I click.

In my index.php i have this:


<div id="search-wrap">
  Seach values:<br>
  <input name="search-q2" id="search-q2" type="text" onkeyup="javascript:autosuggest2()" value="write a value...."/>

To search the values i have the file "seach_values.php" and i have this:


  $searchq      =  strip_tags($_GET['q']);
  $getRecord_sql = "select pkey from TABLE where project = '10000' and pkey like '%".$searchq."%'";
  $getRecord      =  mysql_query($getRecord_sql);
  echo '<ul>';
  while ($row = mysql_fetch_array($getRecord)) {

<li><a href="lib/consultas.php?accion=E" onclick="load('lib/consultas.php?accion=E','consulta');return false;">

  echo $row['pkey'];


}echo '</ul>';

This is correct, because i see the results when i write into my input box.
But, when I click into one value (into <li>) the results all times are: "Query was empty"

I put the case "E" from "consultas.php":


case 'E':     

echo "<br>";
        echo my value is....;
echo "<br>";
        echo $which is the value I clicked??????;
echo "<br>";

now, if i change this line:


<li><a href="lib/consultas.php?accion=E" onclick="load('lib/consultas.php?accion=E','consulta');return false;">
and put:


<li><a href="lib/consultas.php?accion=E&<?php echo $row['pkey']; ?>" onclick="load('lib/consultas.php?accion=E','consulta');return false;">
I see the item of <li> name into the link but if i make a click, the echo don't give any result...

guif 4Feb2009 19:37

Re: problems with my Autosuggest project
Now, I see the element!!!
I change this:


<li><a href="lib/consultas.php?accion=E" onclick="load('lib/consultas.php?accion=E','consulta');return false;">


<li><a href="lib/consultas.php?accion=E" onclick="load('lib/consultas.php?accion=E&id=<?php echo $row['pkey']; ?>','consulta');return false;">
if I put in case E:

echo $_GET['id'];

I see the element that i Clicked.

but... i would like to insert a MySQl query:


$queEmp = "select pkey, UPDATED, reporter, resolution, summary from `jiraissue` where pkey like $_GET['id']";
why did not run?

pradeep 6Feb2009 10:43

Re: problems with my Autosuggest project
Code: php

$queEmp = "select pkey, UPDATED, reporter, resolution, summary from `jiraissue` where pkey like '".$_GET['id']."'";

All times are GMT +5.5. The time now is 03:07.