MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 29th, 2007, 01:04 PM
Jinksko Jinksko is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 1 Jinksko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 27 sec
Reputation Power: 0
Another mysql_num_rows() problem from newb :(

Hi Guys,

I searched the forum but couldnt seem to figure it out for myself due to me not using sql before

A friend of mine made a database which was linked to WBB permissions. now I'm trying to get it to work with vbulletin but getting the error :

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource .

here is the code

if ($HTTP_COOKIE_VARS['XXX'] && $HTTP_COOKIE_VARS['XXX']) {
$userid = $HTTP_COOKIE_VARS['XXX'];
$a1 = mysql_db_query($phpdb,"SELECT * FROM XXX WHERE userid = '$userid'");
if (mysql_num_rows($a1) == 1) {
$cpass = mysql_result($a1,0,"XXX");
if ($cpass == $HTTP_COOKIE_VARS['XXX']) {
$username = strtolower(mysql_result($a1,0,"XXX"));

Reply With Quote
  #2  
Old January 8th, 2008, 01:25 PM
Rohan Shenoy Rohan Shenoy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 5 Rohan Shenoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 17 m 21 sec
Reputation Power: 0
Ok, I feel this is what you want to do with the script:
1. check if the two cookies are set.
2. If set, you want to use the values stored in those cookies(Eg: username and passwords) to run some query.

Now what I feel is that to check if the cookie is set, you may use the inbuilt isset() function.
More info about isset() at tizag.com/phpT/phpsessions.php

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Another mysql_num_rows() problem from newb :(


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway