| | |
Passing variable sql php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2007
Posts: 30
Reputation:
Solved Threads: 1
Hi,
I have a web site in which I pass many javascript variables to php and the other way round. This is my last passing variable challenge, and I cannot figure it out.
There's an alphabet letter that i pass into showhide1(v) function, and i try to pass it to IN(). For example IN ('b') will retrieve all items beginning with letter b.
The way I did it below does not work for some reason. Does anyone know how to do it?
Thanks
I have a web site in which I pass many javascript variables to php and the other way round. This is my last passing variable challenge, and I cannot figure it out.
There's an alphabet letter that i pass into showhide1(v) function, and i try to pass it to IN(). For example IN ('b') will retrieve all items beginning with letter b.
The way I did it below does not work for some reason. Does anyone know how to do it?
Thanks
PHP Syntax (Toggle Plain Text)
function showhide1(v) { <?php $result = mysql_query("SELECT * FROM birdstable WHERE left(Name, 1) IN ($_GET[v]) ORDER BY Name;"); while($row = mysql_fetch_assoc($result)){ $varr= $row['BirdID']; ?> document.getElementById("Layer1").innerHTML = "hello"; <?php } ?> }
Last edited by Mylena; Oct 4th, 2008 at 2:53 pm.
i think you can't get the java script function values by this way: $_GET[v].
if you want to send javascript values to php try this way:
And the you can get the function value by $_GET['v'];
then pass it to N() ...
if you want to send javascript values to php try this way:
PHP Syntax (Toggle Plain Text)
function showhide1(x) { d.action="yourpage.php?v="+x; d.submit(); }
then pass it to N() ...
Last edited by Shanti Chepuru; Oct 6th, 2008 at 4:08 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
![]() |
Similar Threads
- passing an ip address in the url. (PHP)
- pagination not displaying results (PHP)
- Passing Variables (PHP)
- get html element value using php (PHP)
- Can a text link pass php variables? (PHP)
- Passing a LINK as a session variable (PHP)
- passing variables threw query (MySQL)
- Zend PHP Certification (PHP)
- PHP Form Input (PHP)
Other Threads in the PHP Forum
- Previous Thread: Please help me with sorting column heading
- Next Thread: Image upload into directory storing path in database
| Thread Tools | Search this Thread |
advanced apache api array basics beginner binary broken cakephp check checkbox class cms code codingproblem combobox cookies cron curl database date datepart display dynamic echo email error file files folder form forms function functions google head href htaccess html image include includingmysecondfileinthechain insert ip javascript job joomla js limit link login mail menu mlm mobile multiple mysql nodes oop outofmemmory paging parse password paypal pdf php problem procedure query radio random recursion remote script search server sessions smarty sms source space sql stored syntax system table traffic tutorial unicode up-to-date update upload url validation validator variable video web webapplications youtube






