Jump to content

Undefined index and selecting Max date


bbram

Recommended Posts

Hello I am getting an error in my php code.

I think the error is in the first line of code but I am not 100% for sure.  The error states...

Notice: Undefined index: paid_date ...

 

Can you tell me if I am going down the correct route to select the max date in a column?

 

[b]$query = "Select MAX(paid_date) as paidDate from players INNER JOIN players_paid ON players.player_number=players_paid.player_number";
$query = mysql_query($query) or die(mysql_error());[/b]



/*SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name*/

//echo "SELECT 1  FROM players_paid  WHERE (((players_paid.player_number)="+str_replace("'","''",$rsNewPlayer__ssPlayerNumber)+") AND ((players_paid.paid_type)=1))";



?>
<html>
<body>
<?PHP echo $user; ?>
<br>
<?php echo $password; ?>
<br>

<?PHP 
while($rows=mysql_fetch_assoc($query))

{

?>
<table width="100%" border="1">
  <tr>
    <th scope="col"><?PHP echo $rows['paid_date'] ?></th>
   
  </tr>
</table>
<?PHP 
}
?>
</body>
</html>

 

Link to comment
https://forums.phpfreaks.com/topic/224499-undefined-index-and-selecting-max-date/
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.