Jump to content

Can Anyone Solve This?


Go to solution Solved by kicken,

Recommended Posts

First off, thanks for your assistance in advance.  I attempted to use an array, userFullName, which is equal to userFName and userLName, to search the database for existing users.  I tried the setup that you see in the screenshots with a whole slew of other variations from concatenation of the userFName.userLName variables in the signup-inc PHP file to what you see in the bottom screenshot.  The fatal errors went from expects exactly 1 argument, given 2 to low count, given 3 arguments expecting 4. I can use an assist here.  I am relatively new to PHP, so laid back laymen terms would be well appreciated.  I have a column in the database for all three variables and need the userFullNAME for other features that will come later on.  Thanks.

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/315626-can-anyone-solve-this/
Share on other sites

  • Solution

Look at the documentation for mysqli_stmt_prepare.  Notice it says the function only accepts one parameter which is the connection.

Now look at your code and notice that you are passing two parameters, the connection and the SQL string.  You need to remove the extra parameter.

 

  • Thanks 1

Also your WHERE clause syntax looks incorrect.

And why are you storing the userFullName when it is easily derived from the first and last names when required? Unnecessary duplication.

EG

SELECT concat(userFName, ' ', userLName) as fullname FROM guests;

 

And if you are showing us code or error messages it is better to cut and paste it into a code window in this forum and not do "screenshots".  That way if we want to help you we can edit the code and re-post it for you to then use.  

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.