Jump to content

[SOLVED] Using an array with a db query


spillage

Recommended Posts

Sorry to be a noobie pain in the butt but having problems trying to work this one out.

 

if $cust=$_POST['all']{
while($row = mysql_fetch_array($result))
   {
echo $row['printer_type']."  | ".$row['Cust_Email']," | ".$row['Friends_Email'];
    echo "<br />";
   }}
   
else if $cust=$_POST['cust']
   {
while($row = mysql_fetch_array($result))
   {
echo $row['printer_type']."  | ".$row['Cust_Email']," | ";
    echo "<br />";
   }}

 

$cust is from a drop down menu which is working as I can echo the result and get the corrct output

and though the above would work but have searched around the correct answer without joy and starting

to really struggling.

 

If I am (and probally am) being a thick idiot please let me know and Ill spent a while longer searching for the

answer as I quite often have my brain in the wrong gear.

 

Cheers,

 

Spill

Link to comment
Share on other sites

is as follows

 

$result = mysql_query("SELECT * FROM submit WHERE printer_type LIKE '%$printer%'");

 

if this is used with

while($row = mysql_fetch_array($result))
   {
echo $row['printer_type']."  | ".$row['Cust_Email'],";
    echo "<br />";
}

this works fine regardless of which $row I select to be printed. But am trying to select the results printed.

 

Spill

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.