brad12345 Posted March 31, 2008 Share Posted March 31, 2008 hi all i think my database has been updated and i want to check to see if the rows have been updated in my table how would i go about this? $addOwner = $_POST['addOwner']; $phoneNumber = $_POST['phoneNumber']; $address = $_POST['address']; $ownerName = $_POST['ownerName']; $title = $_POST['title']; echo("<font face='Arial'>"); $self = $_SERVER['PHP_SELF']; if (isset($_POST['addOwner'])) { //Insert new owner data into the database martinb $createQuery1 = "INSERT INTO tblOwnerBK (title, ownerName, address, phoneNumber) VALUES ('$title','$ownerName','$address','$phoneNumber')"; $selectString = "SELECT * FROM tblOwnerBK"; //Selects all owner details // dont know what to do after this???? Link to comment https://forums.phpfreaks.com/topic/98797-how-do-i-output-my-database-data-echo/ Share on other sites More sharing options...
oron Posted March 31, 2008 Share Posted March 31, 2008 Not sure whether this is what your looking for, haven't done php for a while so sorry if it doesnt work $addOwner = $_POST['addOwner']; $phoneNumber = $_POST['phoneNumber']; $address = $_POST['address']; $ownerName = $_POST['ownerName']; $title = $_POST['title']; echo("<font face='Arial'>"); $self = $_SERVER['PHP_SELF']; if (isset($_POST['addOwner'])) { //Insert new owner data into the database martinb $createQuery1 = "INSERT INTO tblOwnerBK (title, ownerName, address, phoneNumber) VALUES ('$title','$ownerName','$address','$phoneNumber')"; $selectString = "SELECT * FROM tblOwnerBK"; //Selects all owner details while($row = mysql_fetch_assoc($selectString)) { echo $row['title]; //Then just keep doing the same for the rest of them, and add some formatting } Link to comment https://forums.phpfreaks.com/topic/98797-how-do-i-output-my-database-data-echo/#findComment-505570 Share on other sites More sharing options...
brad12345 Posted March 31, 2008 Author Share Posted March 31, 2008 im getting this error back Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Link to comment https://forums.phpfreaks.com/topic/98797-how-do-i-output-my-database-data-echo/#findComment-505644 Share on other sites More sharing options...
BlueSkyIS Posted March 31, 2008 Share Posted March 31, 2008 the string $selectString is not a mysql resource. you have to run the query to get the resource: $resource = mysql_query($selectString) or die(mysql_error(). " in $selectString"); Link to comment https://forums.phpfreaks.com/topic/98797-how-do-i-output-my-database-data-echo/#findComment-505724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.