473,387 Members | 1,485 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,387 software developers and data experts.

Keep getting "Resource ID #4"

Markus
6,050 Expert 4TB
I'm trying to compare the random password i generated against the current password to see whether it needs changing or not.

But i hit this, and can't see what's wrong with it.

I'm using the mysql_fetch_array so i don't see why its saying Resuorce ID #4

:(
[php]
<?php
include("../library/config.php");
include("../library/opendb.php");
$pass = mysql_query("SELECT `ziprar_loginPass` FROM `ziprar_users` WHERE `ziprar_loginName` =

'markusn00b'");
$row = mysql_fetch_array($pass);
$change = mysql_query("SELECT `ziprar_passChange` FROM `ziprar_users` wHERE

`ziprar_loginName` = 'markusn00b'");
$change = mysql_fetch_array($change);
echo $row['ziprar_loginPass'];
/*
if($pass['ziprar_loginPass'] === $change['ziprar_passChange']){
echo "Change password";
} else{
echo "Password changed";
}
*/
?>
[/php]
Oct 26 '07 #1
3 2246
ak1dnar
1,584 Expert 1GB
Your first query string will execute first and it will store the Result resource in $pass variable with the help of mysql_query function. And then by using mysql_fetch_array($pass) you are going to store that result resource on $row variable.Correct. BUT again with your IF block why you trying get a OUTPUT from $pass variable. You can’t do that.

What you have to do
Expand|Select|Wrap|Line Numbers
  1. $pass = mysql_query("SELECT `ziprar_loginPass` FROM `ziprar_users` WHERE `ziprar_loginName` = 'markusn00b'");
  2. $row_pass = mysql_fetch_array($pass);
  3. $var_pass = $row_pass ['ziprar_loginPass']
  4.  
  5. $change= mysql_query("SELECT `ziprar_passChange` FROM `ziprar_users` wHERE `ziprar_loginName` = 'markusn00b'");
  6. $row_change = mysql_fetch_array($change);
  7. $var_change = $row_change['ziprar_passChange']
  8.  
Then Compare $var_pass and $var_change
Oct 26 '07 #2
Markus
6,050 Expert 4TB
Your first query string will execute first and it will store the Result resource in $pass variable with the help of mysql_query function. And then by using mysql_fetch_array($pass) you are going to store that result resource on $row variable.Correct. BUT again with your IF block why you trying get a OUTPUT from $pass variable. You can’t do that.

What you have to do
Expand|Select|Wrap|Line Numbers
  1. $pass = mysql_query("SELECT `ziprar_loginPass` FROM `ziprar_users` WHERE `ziprar_loginName` = 'markusn00b'");
  2. $row_pass = mysql_fetch_array($pass);
  3. $var_pass = $row_pass ['ziprar_loginPass']
  4.  
  5. $change= mysql_query("SELECT `ziprar_passChange` FROM `ziprar_users` wHERE `ziprar_loginName` = 'markusn00b'");
  6. $row_change = mysql_fetch_array($change);
  7. $var_change = $row_change['ziprar_passChange']
  8.  
Then Compare $var_pass and $var_change
Legend! Thanks a bunch.

Do you know why it has to be like that though?

Cheers.
Oct 26 '07 #3
ak1dnar
1,584 Expert 1GB
Legend! Thanks a bunch.

Do you know why it has to be like that though?

Cheers.
After taking the result resource from mysql_query, you must use one of the mysql functions that take mysql results resources as input and processes them. exaples for these are mysql_fetch_assoc,mysql_fetch_array
You have not done this for second sql query
Oct 26 '07 #4

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

Similar topics

11
by: Jim H | last post by:
I am trying to go through my Outlook (2003) address book. The code goes through the Items list and prints all the last names but after it hits 114 (out or 126 contacts) I get a "sepcified cast is...
0
by: gg | last post by:
Hello, who can tell me how to use the Resource Assembly File (*.resx) in a project. For example: I define a item Name :"TestString" Vale "1234567890" in a Resource Assembly File(test.resx). How...
0
by: jmw | last post by:
Anybody know why I suddenly get this Error message in C# 2005 express edition or how to solve it? " Error 36 Resource identifier 'RubberPicker.RubPicMain.resources' has already been used in...
0
by: joef | last post by:
I'm running VS.net on my PC (W2K) connected to a remote IIS server (W2K) SP4 that is not a domain controller. I've got the ASPNET and IWAM accounts in the "Impersonate a client after...
2
by: partybob99 | last post by:
I am trying to call SP_Password from some vb.net code. This should be very straight forward but no matter what I do, I keep getting errors. Here is the code strConnectString = "Data Source=" +...
1
by: Axford | last post by:
Hello everybody, In IIS 6.0 I have a website "AppName" on tcp port 100. Forms authentication is configured with Login.aspx and the start page is Start.aspx. Now I can browse to...
8
by: lawrence k | last post by:
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid...
0
by: GB | last post by:
All, I raised a problem a while ago about custom cultures in .NET and an error whereby a "Resource lookup failed - infinite recursion detected" exception was raised. Usually this was raised when...
1
by: ccon67 | last post by:
In a win32 project I have several compile errors for the resource *.rc. The first fews errors look like this error RC2144 : PRIMARY LANGUAGE ID not a number error RC2135 : file not found:...
1
by: codemania | last post by:
Disappointing me extremely, with the "generate python" function within Resource Editor, I only get a segment of python code which load xrc(xml format) file, rather than real python code in which I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.