473,595 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

invalid result resource from a $_SESSION

I want to save two variables in a $_SESSION for use in another page:

$_SESSION['mark'] = $mark;
$_SESSION['num'] = $num;

then on the other page I did this to get the value:

$mark =$_SESSION['mark'];
$num = $_SESSION['num'];

then I pull a query:
$result = SELECT_clm($mar k,$num);

but on this line I get an invalid result resource
$numrows = mysql_num_rows( $result);

how can I fix this?
tia,
Nov 14 '08 #1
3 2175
JRough wrote:
I want to save two variables in a $_SESSION for use in another page:

$_SESSION['mark'] = $mark;
$_SESSION['num'] = $num;

then on the other page I did this to get the value:

$mark =$_SESSION['mark'];
$num = $_SESSION['num'];

then I pull a query:
$result = SELECT_clm($mar k,$num);

but on this line I get an invalid result resource
$numrows = mysql_num_rows( $result);

how can I fix this?
tia,
Find out why your query is failing and correct that problem.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Nov 14 '08 #2
JRough wrote:
I want to save two variables in a $_SESSION for use in another page:

$_SESSION['mark'] = $mark;
$_SESSION['num'] = $num;

then on the other page I did this to get the value:

$mark =$_SESSION['mark'];
$num = $_SESSION['num'];

then I pull a query:
$result = SELECT_clm($mar k,$num);

but on this line I get an invalid result resource
$numrows = mysql_num_rows( $result);

how can I fix this?
tia,
Debugging 101:

Did you check that your values for $mark and $num are what you expect?

print_r($_SESSI ON);

if you are getting expected values then test your SELECT_clm function.

Manually feed known values into your SELECT_clm function, that is more
then likely your issue.

SELECT_clm('mar k','num');

This is how you draw down your problem.

Send us code of your function and it is easier, it is hard to debug a
black box function without the code.

Scotty
Nov 14 '08 #3
On Nov 13, 8:18*pm, FutureShock <futuresho...@a tt.netwrote:
JRough wrote:
I want to save two variables in a $_SESSION *for use in another page:
$_SESSION['mark'] = $mark;
$_SESSION['num'] = $num;
then on the other page I did this to get the value:
$mark =$_SESSION['mark'];
$num = $_SESSION['num'];
then I pull a query:
$result = SELECT_clm($mar k,$num);
but on this line I get an invalid result resource
$numrows = mysql_num_rows( $result);
how can I fix this?
tia,

Debugging 101:

Did you check that your values for $mark and $num are what you expect?

print_r($_SESSI ON);

if you are getting expected values then test your SELECT_clm function.

Manually feed known values into your SELECT_clm function, that is more
then likely your issue.

SELECT_clm('mar k','num');

This is how you draw down your problem.:
>
Send us code of your function and it is easier, it is hard to debug a
black box function without the code.

Scotty
Is this right on the original page?
$_SESSION['mark'] = $mark;
$_SESSION['num'] = $num;
then excel print page it is:
$mark =$_SESSION['mark'];
$num = $_SESSION['num'];
Here is the output of a section of the print_r($_SESSI ON)
center [alignment] =center [17] =90 [thimbnailswidth] =90 [18]
=100 [thumb_show] =100 [19] =y [aboutus] =y [20] =Your About
us text goes here [aboutustext] =Your About us text goes here [21]
=y [terms] =y [22] =Your Terms and Conditions go here
[termstext] =Your Terms and Conditions go here [23] =United States
[defaultcountry] =United States [24] =EN [defaultlanguage] =EN
[25] =99 [pagewidth] =99 [26] =perc [pagewidthtype] =perc [27]
=17 [menuwidth] =17 [28] =sellerbuyer [accounttype] =>
sellerbuyer [29] =y [usersauth] =y [30] =3.gif [background] =>
3.gif [31] =no [brepeat] =no [32] =LMS_navy [theme] =LMS_navy
[33] =n [sitemap] =n [34] =LMS_darkgreen [theme_lessor] =>
LMS_darkgreen [35] =LMS_blue [theme_bidder] =LMS_blue [36] =>
LMS_navy [theme_normal] =LMS_navy ) [std_font] =[LMS_LOGGED_IN] =>
76 [LMS_LOGGED_IN_U SERNAME] =jrough [LMS_LOGGED_EMAI L] =>
jl*****@yahoo.c om [LMS_LOGGED_ACCO UNT] =internal [LMS_LOGGED_NAME]
=janis [LMS_USER_TYPE] =1 [LMS_USER_DESC] =internal [mark] =>
allx [num] =1670 )
I don't know it appears to be right. $_SESSION['mark'] = 'allx' and
$_SESSION['num] = '1670'. It did go past the select query. So I
assume there is a $result.

Now it is stopping on other lines which are 2 and 4 of my function
having to do with the $result variable not being valid:

Error Message:
Warning: mysql_num_rows( ): supplied argument is not a valid MySQL
result resource in /home/allrail/public_html/clm_historyXL.p hp on line
60

Warning: mysql_num_rows( ): supplied argument is not a valid MySQL
result resource in /home/allrail/public_html/clm_historyXL.p hp on line
62
function:

function makexcldata($xc lfields,$result ){
$numrows = mysql_num_rows( $result);
$rowcount =1;
if ($result && mySQL_num_rows( $result)){
while ($row = mysql_fetch_ass oc($result)){
for($i =0; $i < sizeof($xclfiel ds);$i++){
$value .= $row[$xclfields[$i]] ;
$value .= "\t";
}

$value .= "\n";

}
$data = $value;
return $data;
}
}

Could it be there are no rows in the $result?
thanks,
Nov 14 '08 #4

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

Similar topics

4
2827
by: josh dismukes | last post by:
i recieve this error from this part of the code: mysql_fetch_array(): supplied argument is not a valid mysql result resource it's returning a long text from the database which is about 200 characters long. Thanks for any help that is given. <?php
0
987
by: jayeldee | last post by:
Hello all, I have a service that's using CDO 1.21 and Redemption to routinely iterate through a list of users to retrieve some properties which are then written to a database. My problem is that the ExchangeServer property of my service is user-configured and I wanted to have it write to the event log if this value is invalid so that it stops trying to process the users (sometimes in the thousands). Currently, my service is not able...
9
7414
by: Petr Vileta | last post by:
Hi, I'm new here and excuse me if this question was be here earlier. I have a simple code <html><body> <?php <?php $link = mysql_connect("localhost", "user", "password") or die("Grr: " . mysql_error()); mysql_select_db("my_dbf") or die("Grr");
1
2096
by: Akhenaten | last post by:
Any suggestion as to why my fetch_array is bad? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/jkokko/public_html/ask/test.php on line 11 ******************* <?php $dbHost = "localhost"; $dbUser = "user"; $dbPass = "pass"; $dbDatabase = "dbname";
4
7826
by: Ryanlawrence1 | last post by:
Heya, I get these 2 errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 20 You have not entered all the fields Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 34 Sorry You failed to enter the correct old password I was wondering if anyone could help me, I have...
7
1949
by: Big Moxy | last post by:
Can someone please advise me on how to implement this? The data entered by a user on form 1 on page1.php is posted to delete.php to remove that row from a table. After the SQL operation the user is returned to page1.php. How can I determine the success or failure of the SQL operation so I can display an appropriate response message to the user? Thank you!
3
1254
by: chri | last post by:
hi i get the following errors returning me folloing post to data base Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\chris1\My Documents\xampp\htdocs\elp\modify_information.php on line 89 Warning: Cannot modify header information - headers already sent by (output started at C:\Documents and Settings\chris1\My Documents\xampp\htdocs\elp\modify_information.php:89) in...
9
2544
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on this line: $result = $_POST; I need the $result on the clm_historyXL page to print a list to excel because of a header already being sent.
4
6296
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59 Notice: Undefined index: args in /home/mattehz/public_html/acssr/trunk/inc_error.php on line 92 Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_error.php on line 92
0
7955
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8261
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8379
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8019
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8251
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6674
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5839
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2391
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 we have to send another system

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.