473,473 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

i'm going nuts

hi,

i'm new to php mysql and already have a problem with a simple routine

$result=mysql_db_query(jcorp,"select count(*) as bar from users");
$count = mysql_result($result,0,"bar"); //<<<<< this is line 3 in the
script
echo "Active Members $count";
this routine is working fine local coudn't be better

but when i put it on my site i get the following error

Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /home/virtual/site755/fst/var/www/html/active.php on line 3
what is wrong here???? i searched the web for different routines all work
localy but non work on the site they all give much the simelar error

please help me,
tnx


Jul 16 '05 #1
2 1807
I would guess your remote host has a setting somewhere that you're unaware
of.

A possibility: the name of the dB is prepended with something (sometimes
your user name?) -- so the full name is actually "lonewolf_jcorp" or
something. Are you able to make other queries successfully?

PS:
mysql_result($result,0,0)
will run a little faster, and obviate the "as bar" part

"The Lone Wolf" <jc*************@pandora.be> wrote in message
news:R4******************@afrodite.telenet-ops.be...
hi,

i'm new to php mysql and already have a problem with a simple routine

$result=mysql_db_query(jcorp,"select count(*) as bar from users");
$count = mysql_result($result,0,"bar"); //<<<<< this is line 3 in the
script
echo "Active Members $count";
this routine is working fine local coudn't be better

but when i put it on my site i get the following error

Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /home/virtual/site755/fst/var/www/html/active.php on line 3
what is wrong here???? i searched the web for different routines all work
localy but non work on the site they all give much the simelar error

please help me,
tnx

Jul 16 '05 #2
Try to isolate the problem:
1. connect to the db
$conn = mysql_connect(....);
2. select the database
$db = mysql_select_db(...);
3. fire your query
$res = mysql_query("select *...");

AND - check the return values, if something goes wrong, FALSE will
be returned and you should look into the mysql_error()!

HTH!
Rainer

The Lone Wolf schrieb:
hi,

i'm new to php mysql and already have a problem with a simple routine

$result=mysql_db_query(jcorp,"select count(*) as bar from users");
$count = mysql_result($result,0,"bar"); //<<<<< this is line 3 in the
script
echo "Active Members $count";
this routine is working fine local coudn't be better

but when i put it on my site i get the following error

Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /home/virtual/site755/fst/var/www/html/active.php on line 3
what is wrong here???? i searched the web for different routines all work
localy but non work on the site they all give much the simelar error

please help me,
tnx


Jul 16 '05 #3

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

Similar topics

3
by: Jim Davidson | last post by:
Here's what I'm trying to do: I have a string with 30 numbers in it. I want to generate a random number between 0 an 30, go to that position in the string and get that number. Here is the code...
8
by: Tom Szabo | last post by:
cTemp = oNode.cName; aStatList = "term"; window.alert(aStatList); -> "term" window.alert(aStatList.length); -> "0" the above code is going to display "term" and "0" ...
32
by: Fresh Air Rider | last post by:
Hi I understand that ASP.net 2.0 (Whidbey) is going to reduce coding by 70%. Surely this is going to de-skill or dumb down the developer's task and open up the task of web development to less...
132
by: Kevin | last post by:
I don't know if I should even start this topic but here goes. I'm an ex vb6 developer, now developing in C#. The reason why I started developing in C# is because the company that I worked for at...
6
by: Kathy Burke | last post by:
Ugh. I'm using the following in an asp.net. I get an Syntax Error in INSERT INTO Statement on line Cmd1.ExecuteNonQuery(). I've made all my database fields text (just to eliminate that as a...
12
by: Marty | last post by:
It seems all of the sudden that user controls that contain images are referencing image sources relative to the document that I drop the control on. This obviously does not work beacuase the...
4
by: Johnny Emde | last post by:
Hello Newsgroup I'm about going nuts!!! Sometime when I coding a asp.net (using C#) I'll get this wierd error. Configuration Error Description: An error occurred during the processing of a...
1
by: windandwaves | last post by:
Hi I have the following file: --myfile.php <?php if($s) { echo $s; session_id($s); session_start;
5
by: Shelly | last post by:
This ASPX/SqlServer stuff is driving me nuts. 1 - In a previous post I said I had four tables and all were showing up in Object Explorer (MS SQL Server Management Studio Express), but when I went...
16
by: jimmy.musselwhite | last post by:
Hello all It would be great if I could make a number that can go beyond current size limitations. Is there any sort of external library that can have infinitely huge numbers? Way way way way...
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,...
1
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
agi2029
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.