Jump to content

joshbro90

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

joshbro90's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I Got a error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/joshbro9/public_html/test/test.php on line 22 0 line 22 is below while ($row = mysql_fetch_array($sql)) {
  2. Right ok thanks, im going to try and give it ago, il post al ink once i am done
  3. Forgot to mention that im a beginer, il tell you what i inderstand onf the script //THIS SCRIPT ASSUMES THAT YOUR RATINGS ARE ALWAYS NUMERIC //IT WILL WORK WITH NON-DIGIT DATA TYPES BUT THERE ARE OTHER THINGS TO CONSIDER WHEN //DEALING WITH THE COMPARISION OF ALNUM OR ALPHA CHARS <?php [b]This is where it gets the score to place the list down in order of closeness[/b] $i = 0; [b]gets the results from mysql database[/b] $sql = mysql_query("SELECT rate_col FROM thing_table"); [b]This kind of converts it to $row variable[/b] while ($row = mysql_fetch_array($sql)) { [b]This is to say if the number from there databse is greater then the $i varable[/b] if ($row['rate_col'] > $i) { [b]This tells the script to say the row of results[/b] $i = $row['rate_col']; } //END WHILE } [b]This prints the results[/b] //$i CONTAINS THE GREATEST ( OR HIGHEST) VALUE OF THE RATE COL IN THE THING TABLE echo $i; ?> Am i correct in waht i sat above in bold ? also how is the connection made to the database ? thanks
  4. right i have a site with a voting system people vote for things then on the things page it will show there rating if i have a table in a mysql database storing the amout of votes the things have. how could i create a page to show the thing with the highest amout of votes sorry its very brief and please say if you dont get what im saying thanks in advanced
×
×
  • 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.