473,325 Members | 2,771 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,325 software developers and data experts.

Resource ID

Kye
Can anybody please suggest to me where I can look up what a Resource id #71
is??? No success so far looking for what the resource codes are on the net.

--
Yours Sincerely
Kye
Oct 19 '07 #1
6 7149
Can anybody please suggest to me where I can look up what a Resource id #71
is??? No success so far looking for what the resource codes are on the net.
As far as I know, that is the 71st resource you create in your script.
There are functions for getting the type of the resource if you don't
know it. A resource is a PHP-special data type and is used for files,
database connections and a lot more. I don't think you can get much more
details than the resource type.

Good luck,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Oct 19 '07 #2
On 19 Oct, 11:02, "Kye" <desca...@hotmail.comwrote:
Can anybody please suggest to me where I can look up what a Resource id #71
is??? No success so far looking for what the resource codes are on the net.

--
Yours Sincerely
Kye
The manual has whole sections explaining about resources.
http://uk2.php.net/manual/en/languag...s.resource.php
so I don't know where you were looking.

Oct 19 '07 #3
Kye
As far as I know, that is the 71st resource you create in your script.
There are functions for getting the type of the resource if you don't
know it. A resource is a PHP-special data type and is used for files,
database connections and a lot more. I don't think you can get much more
details than the resource type.
So is there any way to know why :

<td class="pageHeading">
<? if ( isset($_POST[dropdown]) ) {
$heading = mysql_query("SELECT links_categories.category,
links_categories.cat_id FROM links_categories WHERE $_POST[dropdown] =
links_categories.cat_id") or die('Error, Heading select failed');
} else {
$heading = "Markets, Fairs, Fetes and Field Days";
}
echo $heading; ?></td>

is returning a Resource ID # 71 or occasionally # 73???

--
Yours Sincerely
Kye
Oct 19 '07 #4
Kye
I am currently occupied smacking myself for looking at this for AGES and
missing the obvious. Thanks Paralytic for the manual reference that led me
to what I was doing wrong.

Thankyou also Willem for helping me even though I (as usual) was the error.

--
Yours Sincerely
Kye
Oct 19 '07 #5
In our last episode, <N7****************@news-server.bigpond.net.au>, the
lovely and talented Kye broadcast on comp.lang.php:
>As far as I know, that is the 71st resource you create in your script.
There are functions for getting the type of the resource if you don't
know it. A resource is a PHP-special data type and is used for files,
database connections and a lot more. I don't think you can get much more
details than the resource type.
So is there any way to know why :
><td class="pageHeading">
<? if ( isset($_POST[dropdown]) ) {
$heading = mysql_query("SELECT links_categories.category,
links_categories.cat_id FROM links_categories WHERE $_POST[dropdown] =
links_categories.cat_id") or die('Error, Heading select failed');
} else {
$heading = "Markets, Fairs, Fetes and Field Days";
}
echo $heading; ?></td>
is returning a Resource ID # 71 or occasionally # 73???
That's right. $heading is a Resource ID. What number it is depends upon
the particular instance of your query within your script. It is merely a
handle on the return of your query. You must fetch your result according to
the type of result you expect. See the mysql_fetch_* functions in the
manual. If you expect a row use mysql_fetch_row($heading), if you expect a
hash use mysql_fetch_assoc($heading) and so forth. Because resources are
pretty much meaningless outside of particular query instances, they are
usually named something like $result, for example:
<? if ( isset($_POST[dropdown]) ) {
$result = mysql_query("SELECT links_categories.category,
links_categories.cat_id FROM links_categories WHERE $_POST[dropdown] =
links_categories.cat_id") or die('Error, Heading select failed');
$heading = mysql_fetch_row($result);
$heading = my_function_to_make_heading_pretty($heading);
} else {
$heading = "Markets, Fairs, Fetes and Field Days";
}
echo $heading; ?>

If you experiment with the mysql client on the command line and try using it
in contexts in which you pipe results to other programs you will soon
understand that mysql results can be interpreted in different ways which is
why PHP gives you a handle on results so you can choose the appropriate
interpretation.

Also, because line breaks, quoting, escaping, and so forth in the query
string can be messy, it is typical practice to compose the query string
outside the mysql_query.

<? if ( isset($_POST[dropdown]) ) {
$query = 'query string ' . "carnage" . ' and ugliness';
$result = mysql_query($query) or die('Error, Heading select failed');
$heading = mysql_fetch_row($result);
$heading = my_function_to_make_heading_pretty($heading);
} else {
$heading = "Markets, Fairs, Fetes and Field Days";
}
echo $heading; ?>

Really, there are many examples with the mysql functions in the manual. It
would pay you to study them.

--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Countdown: 459 days to go.
What do you do when you're debranded?
Oct 19 '07 #6
..oO(Kye)
>As far as I know, that is the 71st resource you create in your script.
There are functions for getting the type of the resource if you don't
know it. A resource is a PHP-special data type and is used for files,
database connections and a lot more. I don't think you can get much more
details than the resource type.

So is there any way to know why :

<td class="pageHeading">
<? if ( isset($_POST[dropdown]) ) {
Here's another problem:

Short open tags are bad and unless 'dropdown' is a defined constant, the
line above will throw a notice. Make sure that error_reporting is set to
E_ALL or E_ALL|E_STRICT in your php.ini on your development machine.

Micha
Oct 20 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
5
by: John Perks and Sarah Mount | last post by:
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close()
5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
0
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have...
7
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
2
by: WT | last post by:
Hello, Could we use 'Embedded resources' with resx files that contain text resources used in aspx pages with the syntaxe: Text="<%$ Resources:ResourcesMy,KEY1 %>" I tryed removing the...
21
by: DiAvOl | last post by:
Hello, I am using a simple php server that I wrote and have some questions related to the resource id's. When a new client connects to the server or the server opens a file the Resource id...
12
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
0
by: CSharper | last post by:
Just curious, When you are in IDE, you are able to add a resource to the project through resource tab. Later this resource can be accessed using the resource manager. One good thing about this...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.