i need help with mysql

Problems with the Windows version of XAMPP, questions, comments, and anything related.

i need help with mysql

Postby rashawn1312 » 04. October 2009 08:00

i keep getting this error code
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\xbox_mods_repairs\includes\php\mysql.php on line 6
Could not connect: Access denied for user 'root'@'localhost' (using password: YES)
Code: Select all
<?php
$servername = "127.0.0.1";
$username = "root";
$password = "cDjrXGtXGUmVSe8t";
$db = "socialnetworkin";
$con = mysql_connect($servername,$username,$password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }



mysql_close($con);
?>
rashawn1312
 
Posts: 3
Joined: 04. October 2009 04:23

Re: i need help with mysql

Postby aj123cd » 04. October 2009 10:11

4 a root user try with out password.
$password="";
aj123cd
 
Posts: 62
Joined: 03. June 2009 08:19
Location: London,UK

Re: i need help with mysql

Postby rashawn1312 » 04. October 2009 20:11

thanks it worked perfectly
rashawn1312
 
Posts: 3
Joined: 04. October 2009 04:23

hey another mysql problem

Postby rashawn1312 » 04. October 2009 20:31

wut does this mean
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\xbox_mods_repairs\includes\php\categories.php on line 7
heres the source code
Code: Select all
<?php
include("includes/php/mysql.php");
$html_query = "select * from categoreis";

$query = mysql_query($html_query);

 while($data=mysql_fetch_array($query)){
    echo"<tr><td>
    <li> {$data['name']} </li>
    </td></tr>";
 }
?>
rashawn1312
 
Posts: 3
Joined: 04. October 2009 04:23

Re: hey another mysql problem

Postby Nobbie » 04. October 2009 20:41

I think it probably means, that you either urgently should read MySQL Documentation, learn how to evaluate return values, learn how to use mysql_error() function and last not least have to know, that "categoreis" is a typo and should be "categories" instead.

And please, really learn about MySQL return codes and error handling.
Nobbie
 
Posts: 8780
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 37 guests