| | |
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 |
# 5.2.10 access alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube






