473,549 Members | 2,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't login to my own forum, that sucks

57 New Member
I'm unable to login? plz help

Expand|Select|Wrap|Line Numbers
  1.  
  2. session_start();
  3. include_once ('dbconnect.php');
  4.  
  5.  
  6. if(isset($_POST['log'])) {
  7.     $dbselect = mysql_query("USE codb");
  8.     $uname = mysql_real_escape_string($_POST['username']);
  9.     $upass = mysql_real_escape_string($_POST['pass']);
  10.     $sql = mysql_query("SELECT * FROM users WHERE username=".$uname." AND password=".$upass." LIMIT 1");
  11.     $res = mysql_query($sql);
  12.  
  13.  
  14.     if(mysql_num_rows($res) == 1) {
  15.         $row = mysql_fetch_assoc($res);
  16.         $_SESSION['user'] = $row['user_id'];
  17.         header("Location: speak.php");
  18.     }else{
  19.         $error = error_reporting(E_ALL^E_WARNING);
  20.         echo "<script>alert('Wrong details!');</script>";
  21.     }
  22.  
  23. }
  24.  
  25.  



It displays
Expand|Select|Wrap|Line Numbers
  1.  
  2. Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\log.php on line 14
  3.  
Jan 30 '16 #1
3 1177
RonB
589 Recognized Expert Moderator Contributor
Your mysql_query($sq l)statement failed i.e., it returned FALSE. Add error checking/handling to that statement to find out why it failed.

Hint, you have a syntax (quoting) error in the query.
Jan 30 '16 #2
Toxicous8
57 New Member
Error checking and handling? what is it?
And where's the quoting error please? tnx
Feb 1 '16 #3
Toxicous8
57 New Member
Error checking and handling? what is it? If it's like

Expand|Select|Wrap|Line Numbers
  1. $error = error_reporting(); 
, then i don't see how it would be useful to fix this problem. If not then what is it?

And where's the quoting error please? tnx
Feb 1 '16 #4

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

Similar topics

1
3894
by: Egon Schneider | last post by:
Hi *, I have a a website running for a bunch of people, written in PHP. Everyone has it's own login, I use some session-based authentication mechanism and a MySQL database for storing the users / passwords / ..... Now I'd like to integrate some 3rd-party-forum into this site, something like phpBB or similar , could also be a more simple...
3
2370
by: tchangmian | last post by:
I want to limit user login by writing ASP program. In details, if a user had logged in wrongly for more than three times, then the user will not be abled to log in to the system anymore even thought he key in correctly the username and password in the 4th time. That's means he cant login forever until the administrator edit his status in the...
3
353
by: clintonG | last post by:
That's the title of the suggestion I just left at MSDN Product Feedback Center . Please login, use that string to find the suggestion I made and vote for it to support my outrageous demands. If you login, you can read the whole story why I have gone over the edge and why something must be done about the File Transfer Manager (FTM). Briefly,...
0
1177
by: Brian | last post by:
Hello, I usually login a forum and post some messages. I can't directly post message because the forum ask me to login first. I guess it need some session information. Now I want to program a C# WinForm to do it. But I heard that the session controll in WinForm and IE are different. Is it possible that I let my WinForm app login first and...
2
2173
by: yaya319 | last post by:
I have been trying for some time to log into my yahoo on my cell phone and it says login incorrect or data server unailable.Please help thank you yaya319
5
1460
by: dba123 | last post by:
Who can I contact to complain about this entire newsgroup UI? It's horrible, and half the time, the right pane doesn't load...even in other browsers. It's sluggish as well, just very choppy. -- dba123
6
3327
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in the past in other places, and while the help was much appreciated, it seemed everyone just wanted to 'theoretically' explain how to do it, but when I...
0
1271
by: =?Utf-8?B?Q2hpV2hpdGVTb3g=?= | last post by:
Hi, i got machine A that has sql2005, vs2005 project. project runs okay there. But when i copied that whole project folder to machine B, running sql2005, VS2005, edited the web.config file to point to SQL2k5 machine A, and then run it at VS2005, it cant connect to the DB at machine A. It says, unable to connect to DB, server doesnt allow...
2
2325
by: beyrself | last post by:
Hi, i've created a application using microsoft visual studio 2005. I've publish the exe application using IIS. now is issue is. I need to restrict the login part. For example is A login to this website.. B cant login until A log off. I'm using VB.net BTW! Below is the code for my login page. Private Sub OK_Click(ByVal sender As...
5
3988
by: lgoddgreat | last post by:
Hi I have this project currently on going and I'm stack in the login form, I've done most of the part but still i cant seem to find a solution to this part. the login form has 2 Textbox and 1 Combobox (usernameTB, passwordTB, userTypeCB) im finish with the part of comparing the username and the password whether the two match in my table, but...
0
7957
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...
1
7470
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...
0
7809
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...
0
6043
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...
1
5368
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...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
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.