Okay, I know how to:
- construct a SQL query and get a result set
- loop through the result set and echo the fields I need
But what I really need to do is get a value from a field and put it in a
variable, and I can't seem to get it to work, because then the variable just
holds "resource id#"
So the query I'm using returns only one row, since I'm filering on the
primary key, and I can test for one row returned. If one row is returned,
how do I pull out the value of one field and put it in a variable?
I know this is very basic stuff, but I can't seem to find the answer. Even
just a very simple reply, pointing me in the right direction would be
greatly appreciated.
Thanks!
Ernie 3 1220
On Sun, 7 Jan 2007 09:39:17 -0800, "ernie.bornheimer"
<er**************@gmail.comwrote:
>Okay, I know how to:
- construct a SQL query and get a result set
- loop through the result set and echo the fields I need
But what I really need to do is get a value from a field and put it in a variable, and I can't seem to get it to work, because then the variable just holds "resource id#" So the query I'm using returns only one row, since I'm filering on the primary key, and I can test for one row returned. If one row is returned, how do I pull out the value of one field and put it in a variable?
mysql_result or mysql_fetch_array.
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
You can also try... mysql_fetch_assoc - this will give you an array of
the values, where the keys of the array would be associative. For
instance, it'll have for a table that's got the fileds "Name" and
"Surname" the following array:
array {
[Name] =peter
[Surname] =pan
}
Andy Hassall wrote:
On Sun, 7 Jan 2007 09:39:17 -0800, "ernie.bornheimer"
<er**************@gmail.comwrote:
Okay, I know how to:
- construct a SQL query and get a result set
- loop through the result set and echo the fields I need
But what I really need to do is get a value from a field and put it in a
variable, and I can't seem to get it to work, because then the variable just
holds "resource id#"
So the query I'm using returns only one row, since I'm filering on the
primary key, and I can test for one row returned. If one row is returned,
how do I pull out the value of one field and put it in a variable?
mysql_result or mysql_fetch_array.
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Thank you both, these suggestions were just what I needed.
Ernie
"Sarel" <sa*****@gmail.comwrote in message
news:11**********************@i15g2000cwa.googlegr oups.com...
You can also try... mysql_fetch_assoc - this will give you an array of
the values, where the keys of the array would be associative. For
instance, it'll have for a table that's got the fileds "Name" and
"Surname" the following array:
array {
[Name] =peter
[Surname] =pan
}
Andy Hassall wrote:
>On Sun, 7 Jan 2007 09:39:17 -0800, "ernie.bornheimer" <er**************@gmail.comwrote:
>Okay, I know how to:
- construct a SQL query and get a result set
- loop through the result set and echo the fields I need
But what I really need to do is get a value from a field and put it in a variable, and I can't seem to get it to work, because then the variable just holds "resource id#" So the query I'm using returns only one row, since I'm filering on the primary key, and I can test for one row returned. If one row is returned, how do I pull out the value of one field and put it in a variable?
mysql_result or mysql_fetch_array.
-- Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dave Williams |
last post by:
First off...total noob to VB. So far have learned a lot in 1.5 days and
feel fairly comfortable at throwing screens up. However, I want to start
writing forms that revolve around an access...
|
by: Matt Hollingsworth |
last post by:
Hello,
Very new to python, so a noob question. When I've written stuff in
JavaScript or MEL in the past, I've always adopted the variable naming
convention of using a $ as the first character...
|
by: davestrike |
last post by:
I am a noob to sql and asp programming. I am working on a db for the
gaming squad I am a member of. One of the pages I created is a roster
list of all the squad members. Part of this roster is...
|
by: We need more power captain |
last post by:
Hi,
I know less than a noob, I've been asked to do some compiles in VC++ 6
without knowing too much at all. (I'm a COBOL program normally so
this is all too much for me)
I open VC++6, open...
|
by: Ivan Shevanski |
last post by:
Alright heres another noob question for everyone. Alright, say I have a
menu like this.
print "1. . .Start"
print "2. . .End"
choice1 = raw_input("> ")
and then I had this to determine what...
|
by: Chris Dunaway |
last post by:
I was looking over some asp.net code and saw this asp:Image control:
<asp:Image ImageUrl="~/images/logo.gif" runat="server" ID="Image1"/>
What does the tilde (~) mean in the ImageUrl...
|
by: Dan McCollick |
last post by:
Hi All,
Noob question that I can not seem to figure out:
I am trying to implement a screenscraper to pull data from two seperate
websites, here is some test code so far:
public static void...
|
by: AndyW |
last post by:
Hey folks.
I am trying to get a soap wsdl service working and have a bit of a
noob php programming question for it. I'm using PHP 5.x btw.
I have written a soap server that contains a...
|
by: Lang Murphy |
last post by:
I'm baaaaack... some of you answered a question I had last week. Only
problem is: I'm a dope who doesn't understand most of what y'all posted. Raw
noob when it comes to .Net and C#.
So I'm going...
|
by: SCRIPT KEEPER |
last post by:
Hello,
I am a complete noob and just starting off with csharp so I apologize for my basic question. I am wanting to start powershell from inside a batch script and then to pass the powershell args...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
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...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |