Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


[solved-myself] Php mysql insert problem
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[solved-myself] Php mysql insert problem

xrzxrz Member
edited April 2016 in Help

//solved - mysql crashed lol before it inserted :D

Problem with insert: Access denied for user 'root'@'localhost' (using password: NO)

php connect via:
mysql_connect("localhost", "root", "root") or die(mysql_error());
mysql_select_db("databasename") or die(mysql_error());

in ssh i can do "mysql -uroot -proot" and works

why php can not insert into mysql?

Comments

  • pbgbenpbgben Member, Host Rep

    Just saw this after your comment about mysql running out of connections, PM me what your trying to do and I'll try to assist in doing it better

  • On a side note, mysql_connect is deprecated in php 5.5+ and removed from php 7, I suggest you use mysqli instead, even if it's only for testing purposes...

  • @pbgben said:
    Just saw this after your comment about mysql running out of connections, PM me what your trying to do and I'll try to assist in doing it better
    @Hybrid said:
    On a side note, mysql_connect is deprecated in php 5.5+ and removed from php 7, I suggest you use mysqli instead, even if it's only for testing purposes...

    Did you guys not see the edit ?

  • @Junkless said:

    @pbgben said:
    Just saw this after your comment about mysql running out of connections, PM me what your trying to do and I'll try to assist in doing it better
    @Hybrid said:
    On a side note, mysql_connect is deprecated in php 5.5+ and removed from php 7, I suggest you use mysqli instead, even if it's only for testing purposes...

    Did you guys not see the edit ?

    When we skim through LET, there's a decent chance that we don't see edits. Plus, it's not like people who post in this thread get a notification of your edit. :)

  • xrzxrz Member
    edited April 2016

    if anyone would have such a problems like me do the following:

    edit php.ini and edit -> and set ->

    mysql.allow_persistent = Off

    :)

  • @doghouch said:

    @Junkless said:

    @pbgben said:
    Just saw this after your comment about mysql running out of connections, PM me what your trying to do and I'll try to assist in doing it better
    @Hybrid said:
    On a side note, mysql_connect is deprecated in php 5.5+ and removed from php 7, I suggest you use mysqli instead, even if it's only for testing purposes...

    Did you guys not see the edit ?

    When we skim through LET, there's a decent chance that we don't see edits. Plus, it's not like people who post in this thread get a notification of your edit. :)

    1. It is not my post, so not my edit.
    2. The post was edited BEFORE any of the replies were made. So at the time of them posting the reply, the original post already had the solution/cause posted. So unless they took more than 40 Mins to read the thread and type the reply, the issue was already solved. So are you telling me that when skimming through LET, people dont even read the FIRST POST fully ?
    3. I don't see myself tagging/quoting you for the edits, so any particular reason you are jumping on me like this ? No offense.
  • doghouchdoghouch Member
    edited April 2016

    @Junkless said:

    @doghouch said:

    @Junkless said:

    @pbgben said:
    Just saw this after your comment about mysql running out of connections, PM me what your trying to do and I'll try to assist in doing it better
    @Hybrid said:
    On a side note, mysql_connect is deprecated in php 5.5+ and removed from php 7, I suggest you use mysqli instead, even if it's only for testing purposes...

    Did you guys not see the edit ?

    When we skim through LET, there's a decent chance that we don't see edits. Plus, it's not like people who post in this thread get a notification of your edit. :)

    1. It is not my post, so not my edit.
    2. The post was edited BEFORE any of the replies were made. So at the time of them posting the reply, the original post already had the solution/cause posted. So unless they took more than 40 Mins to read the thread and type the reply, the issue was already solved. So are you telling me that when skimming through LET, people dont even read the FIRST POST fully ?
    3. I don't see myself tagging/quoting you for the edits, so any particular reason you are jumping on me like this ? No offense.

    If they read it fully, they would've seen the OP's edit. I was just pointing out that editing a post doesn't make it so the page updates with the new information if the person visits the page before it happens.

    To address your last statement: I have my freedoms and so do you. There is something called "freedom of speech" - I have the right to say whatever I wish unless it is either 1) against the LET rules or 2) against the law.

  • @doghouch said:

    @Junkless said:

    @doghouch said:

    @Junkless said:

    @pbgben said:
    Just saw this after your comment about mysql running out of connections, PM me what your trying to do and I'll try to assist in doing it better
    @Hybrid said:
    On a side note, mysql_connect is deprecated in php 5.5+ and removed from php 7, I suggest you use mysqli instead, even if it's only for testing purposes...

    Did you guys not see the edit ?

    When we skim through LET, there's a decent chance that we don't see edits. Plus, it's not like people who post in this thread get a notification of your edit. :)

    1. It is not my post, so not my edit.
    2. The post was edited BEFORE any of the replies were made. So at the time of them posting the reply, the original post already had the solution/cause posted. So unless they took more than 40 Mins to read the thread and type the reply, the issue was already solved. So are you telling me that when skimming through LET, people dont even read the FIRST POST fully ?
    3. I don't see myself tagging/quoting you for the edits, so any particular reason you are jumping on me like this ? No offense.

    If they read it fully, they would've seen the OP's edit. I was just pointing out that editing a post doesn't make it so the page updates with the new information if the person visits the page before it happens.

    To address your last statement: I have my freedoms and so do you. There is something called "freedom of speech" - I have the right to say whatever I wish unless it is either 1) against the LET rules or 2) against the law.

    SMH. Nevermind

  • @Junkless Suit yourself.

  • Hybrid said: On a side note, mysql_connect is deprecated in php 5.5+ and removed from php 7, I suggest you use mysqli instead, even if it's only for testing purposes...

    >

    Best way is to start usnig PDO statements, much more flexibility for various database engines, and much more secure functionality.

Sign In or Register to comment.