This is my first project with PHP and till this point I can’t say I’ve done horribly bad. How would I go about passing a variable to a custom function through a link? I’ll post my code so you can see what I mean. Also, if you see anything that’s an amateur thing to do let me know, the only way I can better myself is with criticism.
The link inside the table should send the ID to the remove_from_DB(). When I tested it, it removed everything in the DB.
[php]<?php //setting DB variables $host = "localhost"; $user = "xxxxx"; $pass = "xxxxx"; $dbase = "test"; $conn = mysql_connect($host,$user,$pass) or die("Could not connect"); $db = mysql_select_db($dbase); $query = mysql_query("SELECT * FROM phones"); echo "
|ID: " .$row['ID']. "||" .$row['name']. "||" .$row['phone']. "||" .stripslashes($row['notes']). "||Remove?|