Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

I"m getting an undefined index error message on this script.

Avatar of jvutechnc
jvutechnc asked on
PHP
26 Comments1 Solution401 ViewsLast Modified:
It has to do with the index act but I can't figure it out.
<?php

include("../dbconnect.php");

$info = mysql_query("SELECT * FROM requests"); 

echo '<table border="1" cellpadding="3" cellspacing="1"> 
  <tr valign="top"> 
    <td>Date</td> 
    <td>From</td> 
    <td>Subject</td> 
    <td>Message</td> 
    <td>&nbsp;</td> 
    <td>&nbsp;</td> 
  </tr>'; 
     
if (mysql_num_rows($info) < 1) { 
echo '<tr valign="top"> 
  <td colspan="4">There are no members that match the query. Please go back and try again</td> 
    </tr>'; 
} 

else { 
   while ($qry = mysql_fetch_array($info)) { 

//create the layout 

?>
  <tr valign="top"> 
    <td><?php echo $qry['ID']; ?></td>     
    <td><?php echo $qry['date']; ?></td> 
    <td><?php echo $qry['from']; ?></td> 
    <td><?php echo $qry['subject']; ?></td> 
    <td><?php echo nl2br($qry['message']); ?></td> 
    <td><a href="?act=edit&id=<?php echo $qry['ID']; ?>">Edit</a></td> 
    <td>Delete</td> 
  </tr> 


<?php

   } 
} 


echo '</table>'; 


if ($_GET['act'] == 'edit') {
    require("edit.php");
} 
?>