I have a massive list of values located in the Database “sweebez_ideagen” in the Table “NAICS”.
All I’m trying to do is write a php script that pulls 500 random values and makes a nice list of them.
When I’m in phpmyadmin, I can run the query “SELECT N_DESCRIPTION FROM NAICS
ORDER BY RAND( ) LIMIT 0 , 500” and get everything I want.
But when I tried to code that query to execute in php, i get this:
•
•
•
•
(^ 500 dots in total)
The data should be readable, since the type is as follows:
column: N_DESCRIPTION
type: varchar(250)
encoding: utf8_unicode_ci
Can you tell me what’s wrong? Code is below :
[php]<?php
mysql_connect(“localhost”,“sweebez_ideagen”,“HIDDEN_PASSWORD”) or die (mysql_error());
mysql_select_db(‘sweebez_ideagen’) or die (mysql_error());
$result = mysql_query(“SELECT N_DESCRIPTION FROM NAICS
ORDER BY RAND( ) LIMIT 0 , 500”);
//While there are rows to display
while($row = mysql_fetch_array($result)){
//Display the results from the current row in a list
echo “
echo $row[field_value];
$row = mysql_fetch_array($result);
echo “
}[/php]
THANKS ;D !