Php help

Discussion in 'Software' started by KOB0724, Jul 5, 2005.

  1. KOB0724

    KOB0724 Private First Class

    PHP won't call to MySQL. I think I might have typed in the wrong extention in my php.ini file. This problem arouse when I was given some code to test MySQL and see if everything was working. This is what I think might be of importance:

    From the php.ini file:
    ; Directory in which the loadable extensions (modules) reside.
    extension_dir = "c:\php\ext"

    and

    ;Windows Extensions
    ;Note that ODBC support is built in, so no dll is needed for it.
    ;

    ;extension=php_bz2.dll
    ;extension=php_cpdf.dll
    ;extension=php_curl.dll
    ;extension=php_dba.dll
    ;extension=php_dbase.dll
    ;extension=php_dbx.dll
    ;extension=php_exif.dll
    ;extension=php_fdf.dll
    ;extension=php_filepro.dll
    ;extension=php_gd2.dll
    ;extension=php_gettext.dll
    ;extension=php_ifx.dll
    ;extension=php_iisfunc.dll
    ;extension=php_imap.dll
    ;extension=php_interbase.dll
    ;extension=php_java.dll
    ;extension=php_ldap.dll
    ;extension=php_mbstring.dll
    ;extension=php_mcrypt.dll
    ;extension=php_mhash.dll
    ;extension=php_mime_magic.dll
    ;extension=php_ming.dll
    ;extension=php_mssql.dll
    ;extension=php_msql.dll
    ;extension=php_mysql.dll
    ;extension=php_oci8.dll
    ;extension=php_openssl.dll
    ;extension=php_oracle.dll
    ;extension=php_pdf.dll
    ;extension=php_pgsql.dll
    ;extension=php_shmop.dll
    ;extension=php_snmp.dll
    ;extension=php_sockets.dll
    ;extension=php_sybase_ct.dll
    ;extension=php_tidy.dll
    ;extension=php_w32api.dll
    ;extension=php_xmlrpc.dll
    ;extension=php_xsl.dll
    ;extension=php_yaz.dll
    ;extension=php_zip.dll
    extension=php_mysqli.dll

    This is the code that will not work:

    <html>
    <head><title>Test MySQL</title></head>
    <body>
    <!-- mysql_up.php -->
    <?php
    $host="localhost";
    $user="root@localhost";
    $password="";

    mysql_connect($host,$user,$password);
    $sql="show status";
    $resutl = mysql_query($sql);
    if ($result == 0)
    echo "<b>error " . mysql_errno() . ": "
    . mysql_error() . "</b>";
    else
    {
    ?>
    <!-- Table that displays the results -->
    <table border="1">
    <tr><td><b>Varible_name</b></td><td><b>Value</b>
    </td></tr>
    <?php
    for ($i = 0; $i < mysql_num_rows($result); $i++) {
    echo "<TR>";
    $row_array = mysql_fetch_row($result);
    for ($j = 0; $j < mysql_num_fields($result); $j++)
    {
    echo "<TD>" . $row_array[$j] . "</td>";
    }
    }
    ?>
    </table>
    <?php } ?>
    </body></html>

    I'm using MySQL version 14.7 distrib 4.1.12a, php 5.0.4. apache server 2.0.54, and Windows XP. Thanx for your help in advance.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds