SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    very simple mysql script

    I ahve tried doing mysql but its really not going very fast. I have tried simple scripts from these varioous online places and manuals. I still seem to get an error.

    I have already got the following details

    1, username =unclesirbobby
    2. password ="amberx"
    3. database = test
    4. table called ratephotos which has the following fields

    photo : a text field 20 letters long
    rating : an integer

    What exactly would I write to enter just one or two entries into this tabel. I have even tried doing it from myphpmanager - just copying and pasting the text

    Don't know what I am doing wrong. It seems to connect to the database but entering data seems not to work

  2. #2
    SitePoint Addict
    Join Date
    May 2005
    Location
    London, ON
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $query "INSERT INTO ratephotos (photo, rating) VALUES ('photoHere', 'ratingHere')";
    mysql_query($query) or die ("Insert failed: ".mysql_error()); 
    Ryan Price
    Subscribe to my blog for regular tips and tricks

  3. #3
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Post what code you have and we can tell you where your going wrong
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming


Bookmarks

Posting Permissions

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