Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

help needed

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

help needed

Postby Raisario » Wed Nov 27, 2002 11:40 am

how do you save a text box entry from a previous page then use it in a WHERE part of the sql statement............
Raisario
New php-forum User
New php-forum User
 
Posts: 6
Joined: Tue Nov 26, 2002 2:24 pm

Postby Oleg Butuzov » Thu Nov 28, 2002 4:25 am

can you explain me what are you want to do?

(my english is not good for understendig what are you say)
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Raisario » Fri Nov 29, 2002 11:03 am

look at my newest Topic I posted, it is more detailed and its exactly same question....

I just forgot i already asked this question. hehe
Raisario
New php-forum User
New php-forum User
 
Posts: 6
Joined: Tue Nov 26, 2002 2:24 pm

Postby Oleg Butuzov » Sat Nov 30, 2002 5:51 am

I had delete your post.

Raisario wrote:What i'm trying to do is take an entry from a drop down box from a previous page to my WHERE clause in a SQL statement in a different page.

Dropdown box code from previous page:

<?php
if ($viewby=="description")
{
echo "<FORM NAME='SelectDescription' ACTION='PHPSearchResults2.php?Displayby=description' Method='Post'>
Select Category:<SELECT NAME='description'>
<OPTION SELECTED>The Home MarketPlace
<OPTION SELECTED>Walter Drakes
<OPTION SELECTED>Both
</SELECT>
<INPUT TYPE='submit' Name='cmdSearch' Value='Search'>
</FORM>";
}
?>

SQL statement in a different page:

$query_coupon = mysql_query ("SELECT coupontypes.coupon_id, coupontypes.percent_discount, coupontypes.description, coupons.status, coupons.purchase_amount, coupons.retailer_ordernum, coupons.purchase_time, users.username FROM coupontypes, coupons, users WHERE coupontypes.description = $description");
-------------------------------------------------------------------------------------

This code doesnt work. i need to know how to save entry from previous page without using session variables then use it in my sql statement
pls help a noob ASAP if possible, this project is almost due and teacher is gonna beat me down :cry:



<?php
if ($viewby=="description")
{
echo "<FORM NAME='SelectDescription' ACTION='PHPSearchResults2.php?Displayby=description' Method='Post'>
Select Category:<SELECT NAME='description'>
<OPTION value=some1>The Home MarketPlace</option>
<OPTION value=some2>Walter Drakes</option>
<OPTION value=some3>Both</option>
</SELECT>
<INPUT TYPE='submit' Name='cmdSearch' Value='Search'>
</FORM>";
}
?>


$query_coupon = mysql_query ("SELECT `coupontypes.coupon_id`, `coupontypes.percent_discount`, `coupontypes.description`, `coupons.status`, `coupons.purchase_amount`, `coupons.retailer_ordernum`, `coupons.purchase_time`, `users.username` FROM `coupontypes`, `coupons`, `users` WHERE `coupontypes.description` = '$description'");
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby wiredme » Sun Dec 08, 2002 10:57 pm

Pejone wrote:I had delete your post.

Raisario wrote:What i'm trying to do is take an entry from a drop down box from a previous page to my WHERE clause in a SQL statement in a different page.

Dropdown box code from previous page:

<?php
if ($viewby=="description")
{
echo "<FORM NAME='SelectDescription' ACTION='PHPSearchResults2.php?Displayby=description' Method='Post'>
Select Category:<SELECT NAME='description'>
<OPTION SELECTED>The Home MarketPlace
<OPTION SELECTED>Walter Drakes
<OPTION SELECTED>Both
</SELECT>
<INPUT TYPE='submit' Name='cmdSearch' Value='Search'>
</FORM>";
}
?>

SQL statement in a different page:

$query_coupon = mysql_query ("SELECT coupontypes.coupon_id, coupontypes.percent_discount, coupontypes.description, coupons.status, coupons.purchase_amount, coupons.retailer_ordernum, coupons.purchase_time, users.username FROM coupontypes, coupons, users WHERE coupontypes.description = $description");
-------------------------------------------------------------------------------------

This code doesnt work. i need to know how to save entry from previous page without using session variables then use it in my sql statement
pls help a noob ASAP if possible, this project is almost due and teacher is gonna beat me down :cry:



<?php
if ($viewby=="description")
{
echo "<FORM NAME='SelectDescription' ACTION='PHPSearchResults2.php?Displayby=description' Method='Post'>
Select Category:<SELECT NAME='description'>
<OPTION value=some1>The Home MarketPlace</option>
<OPTION value=some2>Walter Drakes</option>
<OPTION value=some3>Both</option>
</SELECT>
<INPUT TYPE='submit' Name='cmdSearch' Value='Search'>
</FORM>";
}
?>


$query_coupon = mysql_query ("SELECT `coupontypes.coupon_id`, `coupontypes.percent_discount`, `coupontypes.description`, `coupons.status`, `coupons.purchase_amount`, `coupons.retailer_ordernum`, `coupons.purchase_time`, `users.username` FROM `coupontypes`, `coupons`, `users` WHERE `coupontypes.description` = '$description'");



I have a code like this all text is quiried from database : heres the code
<SELECT NAME="day" style='font-family: Verdana; font-size: 10px; border: 1px solid #A0D2FF'>
<?
$resultd = mysql_query("SELECT * FROM days", $link_id);
while ($datad=mysql_fetch_array($resultd))
{
$optiond=$datad['day'];
if ($optiond!="[select one]")
{
if ($day==$optiond)
{
echo "<OPTION selected="selected" VALUE="inputevent.php?day=$optiond" size='20'>$optiond</OPTION>";
}
else
{
echo "<OPTION VALUE="$optiond">$optiond</OPTION>";
}
}
}
?>
</SELECT>
wiredme
New php-forum User
New php-forum User
 
Posts: 7
Joined: Sun Dec 08, 2002 9:02 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron