473,320 Members | 2,133 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,320 software developers and data experts.

Could not check username error, php & mySQL

Hello, for some reason everytime I register on my website, I get "Could not check username" no matter what I use. I'm sure it might be a spelling mistake(?) but I've looked through everywhere and couldn't find it.

Here's my snippet:

Expand|Select|Wrap|Line Numbers
  1. if(isset($_POST['username'])){ }
  2.  
  3.     $username = $_POST['username'];
  4.  
  5. $username = preg_replace("#[^0-9a-z]#i","",$username);
  6.  
  7. $user_query=mysql_query("SELECT username FROM members WHERE username='$username'LIMT 1") or die ("Could not check username");
(Again, this is just a snippet of my php)
May 11 '15 #1
2 1405
Dormilich
8,658 Expert Mod 8TB
well, obviously your SQL query fails. that’s the only place that can trigger your error message.
May 12 '15 #2
Exequiel
288 256MB
ON YOUR QUERY IN LINE No. 7 replace it by this code.

Expand|Select|Wrap|Line Numbers
  1. $user_query=mysql_query("SELECT username FROM members WHERE username='$username' LIMIT 1") or die ("Could not check username");
the error there IN YOUR CODE is that you don't put space between this - username='$username'LIMT 1 it must be username='$username' LIMIT 1 AND ALSO WRONG SPELLING OF LIMIT.
May 14 '15 #3

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

Similar topics

1
by: Ken | last post by:
First time I have installed mysql. I have not been able to connect to the server/database with a new php installation. I have installed IIS. Do I need this for mysql? The php works fine. ...
0
by: David M. | last post by:
Hi, I have this error when I am connected in mysql: ERROR 2006: MySQL server has gone away. No connection. Trying to reconnect... I only did this command: show databases; and received the...
1
by: Dakkar | last post by:
I'm getting this error when i execute my program ERROR Acces denied for user:'root@DAKKAR123' and when i write the line like this i dont take any error MyConn = new...
2
by: ME | last post by:
I am getting: "ERROR SQLBindParameter not used for all parameters" when attempting to run the following code: Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As...
2
by: ad | last post by:
Hi, I use the setting below in Web.config <customErrors mode="On" defaultRedirect="~/ErrorPage/GenericErrorPage.aspx" /> How could we get error statusCode when GenericErrorPage is load?
10
by: Bob Hollness | last post by:
AAARRRGHHH!!! I fix my server, well, I rebuilt it actually. It runs Suse 9.2 and MySQL 4.0.21 When I try to do a Recordset.Update I get the following error. Error Number = -2147217871...
5
by: Matthew Hood | last post by:
I have a DLL I created to handle all unknown errors using the Application.ThreadException event. I'm asking the user if they want to terminate the program or continue. This is working like I...
1
by: dipal | last post by:
I m totally new to php and mysql i got the following error connectivity error in mysql due to authentication protocol i have instaled mysql 4.1 and php 4.1 but still i get this error so can...
1
by: vincedav31 | last post by:
I have a connection to a server and my database. I use it like this in my code : Class.forName("com.mysql.jdbc.Driver"); String DBurl = "jdbc:mysql://138.63.222.7:3306/ns3"; m_connection =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.