The one at www.php.net

-----Original Message-----
From: Taylor Lewick [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 24, 2002 1:50 PM
To: [EMAIL PROTECTED]
Subject: Re: mysql php question


gotcha, thanks, which manual is that?

Taylor Lewick
Unix System Administrator
Fortis Benefits
816 881 6073

"Help Wanted.  Seeking Telepath..."
"You Know where to apply."

>>> [EMAIL PROTECTED] 06/24/02 01:39PM >>>
in the php manual in the section of functions about mysql, it has a few 
examples.

<SNIP>
<?php
    /* Connecting, selecting database */
    $link = mysql_connect("mysql_host", "mysql_user", "mysql_password")
        or die("Could not connect");
    print "Connected successfully";
    mysql_select_db("my_database") or die("Could not select database");

    /* Performing SQL query */
    $query = "SELECT * FROM my_table";
    $result = mysql_query($query) or die("Query failed");

    /* Printing results in HTML */
    print "<table>\n";
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        print "\t<tr>\n";
        foreach ($line as $col_value) {
            print "\t\t<td>$col_value</td>\n";
        }
        print "\t</tr>\n";
    }
    print "</table>\n";

    /* Free resultset */
    mysql_free_result($result);

    /* Closing connection */
    mysql_close($link);
?>
</SNIP>
On Monday 24 June 2002 1:16, you wrote:
> Does anyone have some simple sample code using php to access a mySQL
> database?
>
> Could you post it or send someit to me please?
>
> Taylor Lewick
> Unix System Administrator
> Fortis Benefits
> 816 881 6073
>
> "Help Wanted.  Seeking Telepath..."
> "You Know where to apply."
>
> ****************************************************************
>                       Please Note
> The information in this E-mail message is legally privileged
> and confidential information intended only for the use of the
> individual(s) named above. If you, the reader of this message,
> are not the intended recipient, you are hereby notified that
> you should not further disseminate, distribute, or forward this
> E-mail message. If you have received this E-mail in error,
> please notify the sender. Thank you
> *****************************************************************
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]> Trouble
> unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php 

-- 
mysql, sql, query

****************************************************************
                        Please Note
The information in this E-mail message is legally privileged
and confidential information intended only for the use of the
individual(s) named above. If you, the reader of this message,
are not the intended recipient, you are hereby notified that 
you should not further disseminate, distribute, or forward this
E-mail message. If you have received this E-mail in error,
please notify the sender. Thank you
*****************************************************************

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to