View Full Version : I need two mysql query scripts like on these two sites
jacobkell
Oct 13th 2007, 2:45 pm
They are both mysql query related,but i dont know exactly how to create such script.First example is on http://cheaterhell.com
and other on http://adult-sponsor-search.com/
As you can see,on first site you type keyword and get certain data about it.
On second you select boxes and got results which match that boxes.
Any suggestion?Somewhere must be such scripts beacuse it is nothing complicated,simple mysql query.
nico_swd
Oct 13th 2007, 3:00 pm
It's a bit more than a "simple MySQL query"...
The first:
$keywords = explode("\n", $_POST['foo']);
$keywords = array_splice($keywords, 50);
$keywords = array_map('mysql_real_escape_string', $keywords);
$query = mysql_query("
SELECT *
FROM table_name
WHERE field_name
IN('" . implode("', '", $keywords) . "')
") OR die(mysql_error());
while ($result = mysql_fetch_array($query))
{
// Do whatever with $result
}
Second (similar)
$categories = array_map('mysql_real_escape_string', (array)$_POST['category']);
$query = mysql_query("
SELECT *
FROM table_name
WHERE field_name
IN('" . implode("', '", $categories) . "')
") OR die(mysql_error());
while ($result = mysql_fetch_array($query))
{
// Do whatever with $result
}
These codes are just raw (untested) examples, as we don't have ANY of your database information or anything else related to what you want to do. But you might get the idea...
jacobkell
Oct 13th 2007, 3:28 pm
I already know for that :( I need clone of this two examples.It must be script somewhere.
nico_swd
Oct 13th 2007, 4:13 pm
Lol, thanks for saying that in your first post. :rolleyes:
I posted what you asked for...
Any suggestion?Somewhere must be such scripts beacuse it is nothing complicated,simple mysql query.
......................................
PLUS, the script doesn't consist in much more... but yeah.
jacobkell
Oct 13th 2007, 5:34 pm
Lol, thanks for saying that in your first post. :rolleyes:
I posted what you asked for...
......................................
PLUS, the script doesn't consist in much more... but yeah.
Ah yes indeed you posted answer.But what i can do with part of code?Script include two parts:html interface and second is php code which connect to mysql database and check queries.But still that is not enough :(
nico_swd
Oct 13th 2007, 5:42 pm
You didn't ask for the ENTIRE script initially. I posted what you asked for and you come back telling me you already know this?
Not trying to sound harsh, but you know how to code the PHP part but can't do the HTML interface which consists in a simple form?
I'm not gonna randomly post some code and guess any more. You will have to say EXACTLY what you want and what you have already. Do you even have a database? Do you have data? Do you know what kind of data you want to display?
jacobkell
Oct 13th 2007, 6:25 pm
You didn't ask for the ENTIRE script initially. I posted what you asked for and you come back telling me you already know this?
Not trying to sound harsh, but you know how to code the PHP part but can't do the HTML interface which consists in a simple form?
I'm not gonna randomly post some code and guess any more. You will have to say EXACTLY what you want and what you have already. Do you even have a database? Do you have data? Do you know what kind of data you want to display?
Yes i do have data.And yes i need a working script.
So what i need a form,type a word inside,when i click check i need to see details about that word.Also it need to have option for multiple check.
nico_swd
Oct 13th 2007, 6:38 pm
For the first script.
<form action="script.php" method="post">
<textarea name="foo"></textarea>
<input type="submit" value="Submit" />
</form>
And the second.
<form action="script.php" method="post">
foo <input type="checkbox" name="category[]" value="foo">
bar <input type="checkbox" name="category[]" value="bar">
foo2 <input type="checkbox" name="category[]" value="foo2">
<input type="submit" value="Submit" />
</form>
That's all I can do since mind reading doesn't work over the internet.
jacobkell
Oct 14th 2007, 5:09 am
The thing is what i need is clone of sites which i given as example.
I already founded script which is even better then example on second site.Name of script is dadabik.Now i only need to found script from first example.In any case,thanks for you effort.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.