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
Link to comment
Share on other sites

[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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.