473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Newbie in trouble... HELP ME....

1
Hi

This is the first time i'm using MySQL... So plz forgive me if i say something wrong..

Here it goes:

I'm using

Expand|Select|Wrap|Line Numbers
  1. function product($var){
  2. $query = "SELECT Field01, Field02 FROM Table00 WHERE Field01 ='$var'";
  3. $export = mysql_query($query);
  4. $fields = mysql_num_fields($export);
  5.  
  6. for ($i = 0; $i < $fields; $i++) {$header .= mysql_field_name($export, $i) . "\t";}
  7.  
  8. while($row = mysql_fetch_row($export)) {$line = ''; foreach($row as $value) { if ((!isset($value)) OR ($value == "")) {$value = "\t";
  9. } else { $value = str_replace('"', '""', $value); $value = '"' . $value . '"' . "\t"; } $line .= $value; } $product.= trim($line)."\n";}
  10. echo $product;}
  11.  
  12. ?>
  13.  
This is a function, and $var will be called in a select option like this:
Expand|Select|Wrap|Line Numbers
  1. <option value=''><?php product ($var); ?></option>
to display the results in a select box..

So far so good...

Now the problem...

I need to query in another field, but don't want that it apears on the select box...
I just wanna echo that field in a row later in the script...

Confused???

I need to use something like this:
Expand|Select|Wrap|Line Numbers
  1. $query = "SELECT Field01, Field02, Field03 FROM Table00 WHERE Field01 ='$var'";
but i don't want to show 'Field03' on the select box... just want to echo it like this:
Expand|Select|Wrap|Line Numbers
  1. $anothervar = $row ["Field03"];
later on the script....

Is there a way to do this or am i improvising to much....

Thanks in advanced for the brave membres that answer me...
[i know i can complicate things.... :)]

Se7eN
Sep 22 '06 #1
0 1002

Sign in to post your reply or Sign up for a free account.

Similar topics

31
by: Raymond Hettinger | last post by:
Based on your extensive feedback, PEP 322 has been completely revised. The response was strongly positive, but almost everyone preferred having a function instead of multiple object methods. The...
0
by: Elger | last post by:
Dear Members, A newbie question How do I convert this XML example into HTML (using XSLT)? <DOCUMENT> <PARA> This <BOLD>is</BOLD> a <BOLD>test</BOLD> </PARA> </DOCUMENT>
3
by: kathleen | last post by:
Hi there, I'm new to this forum & to programming in general, and am really stuck with a piece of buggy code. Can anyone help? I have several problems which may or may not be related. I have...
3
by: jcharth | last post by:
Hello a friend of mine was running phpbb on his site and the site got hacked. I am starting a new forum site and i installed punbb. Phpbb has many many nice features that punbb does not have. I had...
0
by: James Barrett | last post by:
Hello All, I'm having some trouble with deligates. Any recommendations on good articles/study guides is greatly appreciated. James
0
jeffbroodwar
by: jeffbroodwar | last post by:
Hi, i'm currently working on a project that uses java and mysql database. can someone give me code & tutorial on how can i make java (using netbeans) read an xml file that contains the fields of the...
2
by: 357HK | last post by:
Hello, I'm writing my first bat script. I'm having trouble assigning the return value of a command to a variable. Here's what I'm trying to do: myvar=ssh2 host command If anyone could point...
3
by: Dkleinen | last post by:
I've written simple HTML code to create a website for a non-profit organization. It is the first site I've created and likely to be the last. I used Dave Taylor's book as a reference guide. I...
5
by: traviswhiskey | last post by:
so i'm trying to read in from a file but having lots of trouble so far all i get are segmentation faults or jibberish numbers when outputting and i just need a little bit of direction on how to solve...
2
by: Zethex | last post by:
At the moment i'm doing a piece of work for school and I'm stuck at the moment. I have a list of words, for example: Sentence = I have another list which I need to use to replace certain...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.