same querie, or a new one??
Posted on
16th Feb 2014 07:03 pm by
admin
Hi guys,
I'm still working on this drop down list. I've got the actual drop down list to work (call all the "pname"s from the table, and I've even found how to print the result once you press submit.... However...
Did you know?Explore Trending and Topic pages for more stories like this.
What I need for this to do is once pname has been selected and submitted, I want the information linked to the pname in other tables to also display...
SO the question is: Do i add the other information I need into the original query, or will it be easier to do another one?? And if the latter, how and where??
Thanks
Gem
Code: <?php
$conn = mysql_connect("CNX") or trigger_error("SQL", E_USER_ERROR);
$db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR);
$sql="SELECT pname FROM pname ORDER BY pname";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
$id=$row["pname"];
$thing=$row["pname"];
$options.="<OPTION VALUE="$id">".$thing.'</option>';
}
?>
<html>
<body>
<FORM action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<SELECT NAME=pname>
<OPTION VALUE=0>Choose
<?=$options?>
</SELECT>
<input type="submit" name="submit" value="submit">
</FORM>
<?php
if(isset($_GET['submit'])){
print stripslashes($_GET['pname']);
}
?>
No comments posted yet
Your Answer:
Login to answer
232
24
Other forums
Form help: Syntax & Logic
Hello again all,
I'm working on a form and ran into a wall (again) and can't seem to think th
Remove directories not empty
hi,
i have an array that contains some names (1,4,6,56...). Every integer is a name of a folder.<
search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please help
Code: [Select]&l
Securing a user input - need some confirmation
Hello All,
I am in the process of recoding a large proportion of an e-commerce site, one of t
[PHP HELP] Php order form.
Hello to everyone @ phpfreaks. Im new to this site and hope to learn lots of things here.
Fir
Adding meta tags under Zend FW
Hello there, recently has come to my hands the FTP of a website which is running under Zend, I would
How to pass parameter to tag query?
Hi,
I want to get the value of a tag at a specific time (like 10/27/09 15:29:59), I need to giv
PHP form authentication
Hi guys,
what am trying to achieve is this: Whenever a user tries to login to my website, an
Creating a function
Basically i wanna put all this code in a seperate file
Code: <?php
ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Obj