Jump to content

jonnash

Members
  • Posts

    4
  • Joined

  • Last visited

jonnash's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay I figured out how to make the link echo "<tr><td>" . $bran . "</td><td>" . '<a href="modsample.php?id=" . $mod . "\">Model</a>' . "</td><td>" . $off . "</td><td>" . $loc . "</td><td>" . $ip . "</td><td>" . $mac. "</td><td>" . $Ink . "</td><td>" . $Stock . "</td><td><a href=\"delete.php?id=" . $id . "\">Delete</a><br /><a href=\"edit.php?id=" . $id . "\">Edit</a></td></tr>"; But I when I get taken to the modsample.php page I get error "Notice: Undefined variable: bran in C:\wamp\www\web\printer 2\printer\admin\modsample.php on line 11" <?php include('includes/PrintFunctions.php'); ?> <html> <head> <title><?php echo $mod; ?></title> </head> <body> <table> <tr> <td>Brand</td><td><?php echo $bran; ?></td> </tr> <tr> <td>Model:</td><td><?php echo $mod; ?></td> </tr> <tr> <td>Office:</td><td><?php echo $off; ?></td> </tr> <tr> <td>Location:</td><td><?php echo $loc; ?></td> </tr> <tr> <td>IP Address:</td><td><?php echo $ip; ?></td> </tr> <tr> <td>MAC Address:</td><td><?php echo $mac; ?></td> </tr> <tr> <td>Ink Type:</td><td><?php echo $Ink; ?></td> </tr> </table> </body> </html>s
  2. thank you! but how do I turn the Model into a link that will get taken to the modsample.php page? function getPrinters() { $query = mysql_query("SELECT * FROM printers") or die (mysql_error()); if (mysql_num_rows($query) == 0) { echo "<tr><td colspan=\"3\">No Printers Were Found</td></tr>"; } else { while($post = mysql_fetch_assoc($query)) { $bran=$post['Brand']; $mod=$post['Model']; $off=$post['office']; $loc=$post['Location']; $ip=$post['IPAddress']; $mac=$post['MACAddress']; $id=$post['id']; echo "<tr><td>" . $bran . "</td><td>" . $mod . "</td><td>" . $off . "</td><td>" . $loc . "</td><td>" . $ip . "</td><td>" . $post['MACAddress'] . "</td><td><a href=\"delete.php?id=" . $id . "\">Delete</a><br /><a href=\"edit.php?id=" . $id . "\">Edit</a></td></tr>"; }
  3. I have a basic sample page with tables that lists the values from the database. I am very lost here <?php include('includes/PrintFunctions.php'); ?> <html> <head> <title><?php echo $Model; ?></title> </head> <body> <table> <tr> <td>Brand</td><td><?php echo $Brand; ?></td> </tr> <tr> <td>Model:</td><td><?php echo $Model; ?></td> </tr> <tr> <td>Office:</td><td><?php echo $Office; ?></td> </tr> <tr> <td>Location:</td><td><?php echo $Location; ?></td> </tr> <tr> <td>IP Address:</td><td><?php echo $IPAddress; ?></td> </tr> <tr> <td>MAC Address:</td><td><?php echo $MACAddress; ?></td> </tr> </table> </body> </html> This is how I originally was hoping the page would look, those values will get pulled from the database and get placed here
  4. hello guys, new to php trying to learn by watching some videos from youtube. I have learned how to insert and show the data from the database. But here is where I am having a bit problem. here is a code function page. function getPrinters() { $query = mysql_query("SELECT * FROM printers") or die (mysql_error()); if (mysql_num_rows($query) == 0) { echo "<tr><td colspan=\"3\">No Printers Were Found</td></tr>"; } else { while($post = mysql_fetch_assoc($query)) { echo "<tr><td>" . $post['Brand'] . "</td><td>" . $post['Model'] . "</td><td>" . $post['Office'] . "</td><td>" . $post['Location'] . "</td><td>" . $post['IPAddress'] . "</td><td>" . $post['MACAddress'] . "</td><td><a href=\"delete.php?id=" . $post['id'] . "\">Delete</a><br /><a href=\"edit.php?id=" . $post['id'] . "\">Edit</a></td></tr>"; } I was wondering how I can create a link for item "Model". So that when someone clicks on Model it will get taken to it's own page and show all those values that were inserted into the database. thanks for your help
×
×
  • 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.