Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: PHP+Mysql

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Posts
    25

    PHP+Mysql

    Hi.

    Well I have 2 litlle problems with mysql and php and I think that someone here can help me.

    So my 1st problem is how can I make mysqld start at boot time. I ask this because I copy the mysql.server file to the /etc/init.d/ and it doesnt run anyway.

    The 2nd problem is a php script that return me this error: "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/esab/public_html/includes/news.php on line 16" and I know that the code of php is rigth because on other box it runs well..

    Thanks and sorry about my english
    neowarez

  2. #2
    Senior Member
    Join Date
    Jun 2002
    Posts
    102
    Not sure about your mysql problem but on php I get that alot because I dont' have the correct table names or field names in the query. Make sure your spelling it right or add a or die statement so you can see a more detailed error
    Good Grief

  3. #3
    Junior Member
    Join Date
    Jan 2002
    Posts
    25
    thanks for your help anyway July
    neowarez

  4. #4
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323
    Could you post the code you are having the problem on? It might help.

    Also what version of PHP are you running on this box versus the other box? What distro are you running? Depending on the distro, there are some simple commands to have MySQL startup automatically.

    MySQL Manual gives some basic startup script hints.
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  5. #5
    Junior Member
    Join Date
    Jan 2002
    Posts
    25
    well I already resolved the 2nd problem ..its a stupid problem with mysqld.. (database) ..

    MsMittens the distro on the box is red hat 7.3..

    I read the Mysql manual and it tell to copy support-files/mysql.server to the startup place ..
    I think that this startup place is /etc/init.d/ but it doesnt run anyway.. because the command to use is "msyql.server start|stop" .. I already change the source so it only be needed to use "mysql.server" so it run as "msyql.server start" but it doesnt work too...

    Do you know what's the problem?
    neowarez

  6. #6
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323
    You rebooted the machine after you copied to the file to see if it started up?

    You can also add the mysql to the chkconfig e.g., chkconfig --add mysql.server

    You can also add the following to the rc.local file:

    Code:
    if [ -x /usr/local/bin/mysqld_safe ]; then
       /usr/local/bin/mysqld_safe &
    fi
    Assuming mysqld_safe is in that directory. Otherwise, put the path to where the file is.

    And lastly, I think you did this but not sure:

    Code:
    # cp mysql.server /etc/init.d/mysql
    # cd /etc/inid.d
    # chmod +x mysql
    # cd /etc/rcx.d
    # ln -s  ../init.dmysql S99mysql
    Where x is a runlevel, # is the root prompt and S99 is a startup script number. This can be the next available big number. The numbers indicate the order in which things are started. A database is best left to the end so even sticking it in a three-digit startup would be good.

    Script information was retreived from MySQL: The definitive guide to using, programming, and administering MySQL 4, 2nd Edition by Paul DuBois. It's well worth it for those who are curious.
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  7. #7
    have yo tried this?? go to /etc/rc.d vi rc.local put this line in. /etc/rc.d/init.d/mysqld start or whatever you called you init script that should start the server at boot.

  8. #8
    Senior Member
    Join Date
    Apr 2002
    Posts
    161
    Hope this helps: I am using Red Hat 8.0 with postgreSQL, but maybe similar config can be used for mysql. Using gnome, go to: server settings ---> services makesure there is a check mark in httpd and mysqld, right click on mysqld and chose restart service, or just restart the whole system. This works for rh 8.0 but i am sure something similar will work for 7.3.

  9. #9
    Junior Member
    Join Date
    Jan 2002
    Posts
    25
    Thanks for your help boys..
    neowarez

  10. #10
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323
    Originally posted here by neowarez
    Thanks for your help boys..
    Hrmph! I'm insulted! BOYS! What about us wimmen??

    :P
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •