need help with my search engine

I have created a search engine by watch a video on youtube and downloading source code from it but when i creted it.When i go to add url here it shows following errors

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘root’@‘localhost’ (using password: YES) in /home/u635743540/public_html/list.php on line 12

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/u635743540/public_html/list.php on line 13

The video url is http://www.youtube.com/watch?v=NFiRdPkJCbA
My site is http://pakiz.cixx6.com
plz help me as soon as possible.

Can you check that when you use [b]mysql_connect[b], that the hostname, username and password are correct? Also, it’s not advised to use the root account for anything apart from adding new users / databases as if a hacker were to compromise your PHP system, get the details then they would have access to all of your databases.

hi i am confuse with user name and MySQL Database here is a picture of it what should i use user name or database name in the picture you can see that with there are numbers with root does i have to write those numbers or just root plz help me img is here http://www.screencast.com/t/b3RtUvsU

Hi,

The MYSQL database password has been mismatched.

Kindly reset the database password to resolve this issue.

these are my codes for list file the code is [php]<?php
$hostname = “localhost”; // usually is localhost, but if not sure, check with your hosting company, if you are with webune leave as localhost
$db_user = “root”; // change to your database password
$db_password = “pakkiz”; // change to your database password
$database = “search”; // provide your database name
$db_table = “searchengine”; // leave this as is

STOP HERE

####################################################################

THIS CODE IS USED TO CONNECT TO THE MYSQL DATABASE

$db = mysql_connect($hostname, $db_user, $db_password);
mysql_select_db($database,$db);
?>

Add your url to out database <?php if (isset($_REQUEST['Submit'])) { # THIS CODE TELL MYSQL TO INSERT THE DATA FROM THE FORM INTO YOUR MYSQL TABLE $sql = "INSERT INTO $db_table(title,description,url,keywords) values ('".mysql_real_escape_string(stripslashes($_REQUEST['title']))."','".mysql_real_escape_string(stripslashes($_REQUEST['description']))."','".mysql_real_escape_string(stripslashes($_REQUEST['url']))."','".mysql_real_escape_string(stripslashes($_REQUEST['keywords']))."')"; if($result = mysql_query($sql ,$db)) { echo '

Thank you

Your information has been entered into our database

'; } else { echo "ERROR: ".mysql_error(); } } else { ?>

Add url


&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Title:
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Description:
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Url:
http://
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Keywords:
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <?php } ?> [/php] for search code is [php]<?php

//get data
$button = $_GET[‘submit’];
$search = $_GET[‘search’];

$s = $_GET[‘s’];
if (!$s)
$s = 0;

$e = 10; // Just change to how many results you want per page

$next = $s + $e;
$prev = $s - $e;

if (strlen($search) < 1) {
echo “You must enter a search query.”;
}
else
{
echo "

";

//connect to database
mysql_connect(“localhost:3063”,“u635743540_root”,“Safi123”);
mysql_select_db(“u635743540_search”);

//explode out search term
$search_exploded = explode(" ",$search);

foreach($search_exploded as $search_each)
{

    //construct query
$x++;
if ($x==1)
 $construct .= "keywords LIKE '%$search_each%'";
else
 $construct .= " OR keywords LIKE '%$search_each%'";

}

//echo outconstruct
$constructx = “SELECT * FROM searchengine WHERE $construct”;

$construct = “SELECT * FROM searchengine WHERE $construct LIMIT $s,$e”;
$run = mysql_query($constructx);

$foundnum = mysql_num_rows($run);

$run_two = mysql_query("$construct");

if ($foundnum==0)
echo “No results found for $search”;
else
{
echo “


Showing 1-10 of $foundnum results found for $search.

”;

while ($runrows = mysql_fetch_assoc($run_two))
{
//get data
$title = $runrows[‘title’];
$desc = $runrows[‘description’];
$url = $runrows[‘url’];

echo "

$title
$desc
$url

"; } ?>
<?php if (!$s<=0) echo "Prev"; $i =1; for ($x=0;$x<$foundnum;$x=$x+$e) { echo " $i "; $i++; } if ($s<$foundnum-$e) echo "Next"; } } ?>
[/php] is this code right or wrong i have use this

i have solve the problems its working nice thanks for help

Sponsor our Newsletter | Privacy Policy | Terms of Service