www.webdeveloper.com
Results 1 to 5 of 5

Thread: Where to start???...Help Please

  1. #1
    Join Date
    Jan 2006
    Posts
    78

    Where to start???...Help Please

    Help.

    I learned PHP and now want to get into MySQL. I have a host w/ MySQL supported and I'm using phpMyAdmin to update. What exactly do I need to do to get my database up and running. I understand the whole SQL language, I just can't seem to get it to work properly. Does anyone know of any good tutorials that deal with incorporating the SQL code into the web document...not just with all the SQL commands??
    Last edited by tenniskid493; 02-03-2006 at 10:22 PM.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,318
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jan 2006
    Posts
    78
    Ok...i get it so far..but how do you execute a multiple line query using mysql_query(

    For example...how would I put this into a code.

    Code:
    INSERT INTO Test
    VALUES ('Name', 'Age', 'Birthday')

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,318
    Note that the multiple lines are just a visual formatting thing - the query would execute the same if you had it all on the same line. However, it is often convenient to break it up to make the source code easier to read. I usually do that by using the "heredoc" method of defining a string:
    PHP Code:
    $query = <<<EOD
    INSERT INTO test
    VALUES ('Name', 'Age', 'Birthday')
    EOD;

    $result mysql_query($query) or die(mysql_error());
    $rows mysql_affected_rows();
    echo 
    "<p>$rows row(s) inserted into database</p>\n"
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Jan 2006
    Posts
    78
    ok..that makes sense
    Last edited by tenniskid493; 02-04-2006 at 04:13 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles