Jump to content

please help me out guys---good php person needed to help me with lil code error


runnerjp

Recommended Posts

hey guys
ok i have set up a shoutbox and a marquee to scroll the text that has been input but it says their is an error but i cant work out why can any one help me ??
this is my connection script
[code]<?php
#################################
include("admin/connect.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT name, message FROM dwg_tag order by id DESC LIMIT 10";
$result = mysql_query($query);
$marquee = "";
$i = 0;
while($r=mysql_fetch_array($result))
{
  $posts[$i] = $r[name].' - '. $r[message]. '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
  ++$i;
}
$marquee = implode("<img src='http://www.runnerselite.com/image/RUNNERSMALL.jpg'>", $posts);

echo "<marquee scrolldelay='110'><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>"

?>[/code]

and this is my connection script

[code]<?php


$host = "localhost";


$user = "";


$pass = "";


$db = "";


$number = "";


$link = mysql_connect("$host", "$user", "$pass");
$dawg_tag = "dawg_tag{$number}";
$dawg_tag_set = "dawg_tag_set{$number}";
$dawg_tag_block = "dawg_tag_block{$number}";
$servertime = time();
[/code]

i cant see the problem :S

error says Warning: mysql_connect(): Access denied for user 'nobody'@'localhost' (using password: NO) in /home/runnerse/public_html/tag/maq.php on line 6
But the error its telling you is that it cannot connect to the database. The (user password: NO) means that the 'nobody'@'localhost' account does not need a password.

Does 'nobody' exist in the priveleges for the database?
[code]mysql_connect("$host","$dbuser","$dbpass") or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT name, message FROM dawg_tag order by id DESC LIMIT 10";
$result = mysql_query($query);
$marquee = "";
$i = 0;
while($r=mysql_fetch_array($result))
[/code]

is this wrong atall because i dont understand how my tagboard itself can connect to my database but when i try accessing it with mysql it says the passwords and user is wrong even tho im useing the same connect.php :S

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.