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
need help with date function
i have following form for date
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Locking mysql tables with php
Hi
BACKGROUND:
I have multiple instances of the same php script running in a WAMP environ
Dynamic Data + Sql Server 2005 Enterprise?
Hi! I have just started to learn ASP.NET, and it looks like it is quite a lot to learn. Im not reall
Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,
I have very strange bug, please help me if you can.
It is reproduced o
Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website
convert static html data into dynamic
hi all
i need to convert a website which has static above 2000 articles into dynamic and add
mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div
OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an
CURL XML Request [From C to PHP]
Hi,
I need some help converting this into something that will work with PHP.
Code: #
Trying to add functions to table
I have this list of characters and I'm trying to figure out what I have to do to put the results of