Jump to content



Photo

Chap 5

inser data

  • Please log in to reply
9 replies to this topic

#1 Mburns1973

Mburns1973

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 5 December 2017 - 12:03 PM

Help,

 OK was able to create my database, all is working fine. When I was trying to INSERT the information is what I need help with.

I keep getting a ~>

Not sure what to do there???

Thank you


  • 0

#2 Mburns1973

Mburns1973

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 5 December 2017 - 12:33 PM

I need to update something here.

When I try to INSERT the info I get a

'>

And it won't let me do anything???


  • 0

#3 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4840 posts
  • LocationState College, PA (USA)

Posted 10 December 2017 - 5:27 PM

You haven't provided much information, but that cursor in the MySQL client indicates you have started a string--you have an opening single quote--and it's waiting for you to complete the string.


  • 0

#4 Mburns1973

Mburns1973

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 11 December 2017 - 8:58 AM

Larry,

 Sorry for the lack of information. I'm new to this. But thank you for the feed back. That is what I get when I write this code.

 

INSERT INTO users

(first_name, last_name, email, pass, registration_date)

VALUES ('Mike','Burns','email@wow.com','SHA1('mypass'), NOW());

'>

 

This is what happens???

Thank you

Mike


  • 0

#5 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4840 posts
  • LocationState College, PA (USA)

Posted 11 December 2017 - 4:17 PM

In what interface are you seeing this? When running a script or when using the command-line MySQL client or...?


  • 0

#6 Mburns1973

Mburns1973

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 11 December 2017 - 9:23 PM

I'm seeing this in MySql console. My php version is 5,7,14.

Thank you


  • 0

#7 abigail

abigail

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts
  • LocationMilwaukee

Posted 12 December 2017 - 12:03 PM

'SHA1('mypass')

 

You have an extra single quote at the start of this snippet.


  • 0

#8 Mburns1973

Mburns1973

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 12 December 2017 - 4:36 PM

Abigail,

 That did something on the right path. I'm past that thank you. Now it's saying "Column count doesn't match value count at row 1" ???

Thank you


  • 0

#9 Mburns1973

Mburns1973

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 12 December 2017 - 8:12 PM

I got it!!!

Thank you Larry and Abigail !!!


  • 0

#10 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4840 posts
  • LocationState College, PA (USA)

Posted 13 December 2017 - 4:00 PM

Excellent. Thanks, Abigail!!!!


  • 0