dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Help Me Iget Mysql Query errors

  1. #1
    Join Date
    Nov 2011
    Posts
    35

    Exclamation Help Me Iget Mysql Query errors

    hi i get this errors when i try my files on my free web host i sure from connect with datebase because other codes work good with datebase
    thats errors:
    Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /srv/disk4/864601/www/cwww.mygamesonline.org/cw/mail.php on line 61

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /srv/disk4/864601/www/cwww.mygamesonline.org/cw/mail.php on line 61

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/disk4/864601/www/cwww.mygamesonline.org/cw/mail.php on line 62
    Thats mail.php

    <?php
    include("check.php");
    include("config.php");
    include("func.php");
    include("ar.php");
    if($_SESSION['user']){
    $check="select * from playersc where username='".$_SESSION['user']."' and password='".$_SESSION['password']."'";
    $result=mysql_query($check);
    $row=mysql_fetch_array($result);
    $id2=$row['id'];
    $town=town($id2);
    include("dayup.php");
    ?>

    <html>
    <head>
    <style>
    a:link.ta { color: blue; font-weight:bold; text-decoration:bold;font-size: 14pt;}
    a:visited.ta { color: blue; font-weight:bold; text-decoration:bold;font-size: 14pt;}
    a:active.ta { color: blue; font-weight:bold; text-decoration:bold;font-size: 14pt;}
    a:hover.ta { color: blue; font-weight:bold; text-decoration:bold;font-size: 14pt;}

    a:link.ta3 { color: #ffffff; font-weight:bold; text-decoration:bold;font-size: 12pt;}
    a:visited.ta3 { color: #ffffff; font-weight:bold; text-decoration:bold;font-size: 12pt;}
    a:active.ta3 { color: #ffffff; font-weight:bold; text-decoration:bold;font-size: 12pt;}
    a:hover.ta3 { color: #ffffff; font-weight:bold; text-decoration:bold;font-size: 12pt;}


    input.t1 {

    font-family: verdana,helvetica;
    color: orange;
    background-color: #660000;
    border: solid 1px #000000;
    font-weight: bold;
    font-size: 14px;
    }
    </style>
    <script type="text/javascript" src="functions.js"></script>
    </head>
    <body bgcolor=#CCA37A>
    <table align=center width=600><tr><td>
    <table align=center>
    <tr><td><img src=logo.jpg width=150 height=150></td><td><font size=6><b><?echo$index[1];?><br><?echo$index[2];?><br> <?echo$index[3];?></b></font></td></tr>
    </table>
    <table align=center width=600 style=" border: 1px solid #000000;"><tr><td>
    <?include("topmenu.php");?>


    <?include("status.php");?>

    <table align=center width=600 bgcolor=#ffffff dir=rtl>
    <tr><td align=center><a href=wmail.php class=ta><?echo$mailr[1];?></a></td></tr>
    <tr><td align=center><font size=3 color=blue><b><?echo$mailr[2];?></b></font></td></tr>
    </table>
    <form method=post action=dmail.php>
    <table align=center width=600 bgcolor=#ffffff dir=rtl>
    <tr><td align=center><font size=3 color=blue><b><?echo$mailr[3];?></b></font></td><td align=center><font size=3 color=blue><b><?echo$mailr[4];?></b></font></td><td align=center><font size=3 color=blue><b><?echo$mailr[5];?></b></font></td></tr>
    <?
    $mail_check="select * from mails where Userto='$town[1]'";
    $result_mail=mysql_query($mail_check);
    while($row_mail=mysql_fetch_array($result_mail)){
    $userfrom2=$rowmail['Userfrom'];
    $sub2=$rowmail['Subject'];
    $date2=$rowmail['Sentdate'];
    echo"<tr><td align=center><font size=3 color=blue><b>$userfrom2</b></font></td><td align=center><font size=3 color=blue><b>$sub2</b></font></td><td align=center><font size=3 color=blue><b>$date2</b></font></td></tr>";
    }
    ?>
    </table>



    <?include("links.php");?>
    </td></tr></table>



    </td></tr></table>
    </body>
    </html>










    <?
    }

    ?>












  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,615
    Where do you do your mysql_connect() (or did you for get to)?
    "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
    Nov 2011
    Posts
    35
    all mysql connect information in config.php
    <?php
    $mysql_server = "fdb3.awardspace.com";
    $mysql_user = "864611_bord";
    $mysql_password = "qwerty";
    $mysql_database = "864611_bord";
    $connection = mysql_connect("$mysql_server","$mysql_user","$mysql_password") or die ("Unable to connect to MySQL server.");

    $db = mysql_select_db("$mysql_database") or die ("Unable to select requested database.");


    ?>

  4. #4
    Join Date
    Jun 2006
    Location
    Under your bed
    Posts
    357
    If those are your real passwords and other details, I'd change them after you're done getting help. Tons of people come on this forum.

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,615
    Well, it sounds like you're not connected, so maybe change that include() to a require(), and make sure it's really loading?
    "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

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