Jump to content

Recommended Posts

hi guys, I have a little problem with this database.

 

I want to put an star rating system on my site and found this script that seems to do the job. I have installed it and it displays the stars and visitors can cast a vote from 1 to 5 and this data (vote, visitor Ip, url of .php file, date) is stored in a mySql database. the problem is I can´t retrieve the data stored in the database... I am going nuts with this cuz not working!!!!  ???

 

The script can be seen workin at this url:

http://www.guideall.com/hsrs/0rating.php

 

The part that is givin all the trouble is the following:

 

 

 

  include "$hm/auth/config.php";

//this works ok, since script saves every votes in the database

 

 

  $link = mysql_connect($hostname, $username,$password);

  if($link)

  {

$dbcon = mysql_select_db($dbname,$link);

  }

 

//averaging rating

 

// THE FREAKING PROBLEM STARS HERE

$qur1 = "select count(*) as dd, avg(rateval) as xx from hsrs where url='$url' group by url";

 

// CANT RETRIVE DATA HERE !!

$result1 = mysql_query($qur1,$link);

mysql_fetch_array($result1, MYSQL_ASSOC);

 

echo sizeof($result1);

 

  // I CANT REACH THIS CONDITION, BECAUSE CANT RETRIVE THE DATA

  if($line = @mysql_fetch_array($result1, MYSQL_ASSOC))

  {

$count = $line['dd'];

$rateval = $line['xx'];

  }

 

 

 

 

?>

 

 

I need help`........ I am going to bed at 4 am for a week working and this and not working.... >:(:(

change

$result1 = mysql_query($qur1,$link);

to

$result1 = mysql_query($qur1,$link) or die("ERROR: $qur1".mysql_error());

 

it won't fix it but will tell you the problem.. post the results back here if your still not sure

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.