Jump to content

Whats this error Mean


dropfaith

Recommended Posts

im lost

 

Notice: Undefined variable: Authors in /home/www/lawrenceguide.org/www/literature/author.php on line 60

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/www/lawrenceguide.org/www/literature/author.php on line 60

 

<?php
// includes
include("../template/conf.php");
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
$genres = array();

$q = "SELECT Author FROM story";
$r = mysql_query($q);

while ( $row = mysql_fetch_row($r) ):

$add = $row[0];

if ( !in_array($add, $Authors) ):

$Authors[] = $add;

Endif;

Endwhile;

$n = count($Authors);

for ($i = 0; $i < $n; $i++):


$Author = $Authors[$i];

$query  = "SELECT id FROM story WHERE Author='$Author' ORDER BY id DESC";
$result = mysql_query($query);

$num    = mysql_num_rows($result);

echo '<tr><td><a href="byauthor.php?Author=' . $Author . '">' . $Author . '</a> ( ' . $num . ' )</td></tr>';


Endfor;

?>

Link to comment
https://forums.phpfreaks.com/topic/127309-whats-this-error-mean/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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