Jump to content

problems with my Autosuggest project


guif

Recommended Posts

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...."/>
<br><br>
</div>

 

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

 

<?php
$searchq		=	strip_tags($_GET['q']);
$getRecord_sql = "select pkey from TABLE where project = '10000' and pkey like '%".$searchq."%'";
$getRecord		=	mysql_query($getRecord_sql);
if(strlen($searchq)>0){
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;">

<?php 
echo $row['pkey'];
?> 

</a>
</li>

<?php 
}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>";

Link to comment
Share on other sites

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[b]&<?php echo $row['pkey']; ?>[/b]" 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...

help....

Link to comment
Share on other sites

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;">

 

for:

 

<li><a href="lib/consultas.php?accion=E" onclick="load('lib/consultas.php?accion=E[b]&id=<?php echo $row['pkey']; ?>[/b]','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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.