Page 1 of 1

Editing,deleating,adding records to a database from PHP

Posted: Wed Mar 17, 2010 8:01 am
by scorpio90
hi guys i wope you can help me,

i wish to use a PHP code to edit, deleate, or add records to a data base(PHPmyadmin).

I have created a database with some infomation in such as post code, address,town etc ..

However, what i would like to do is to have a form which when i access it it gives me the option to search the database for a post code and house number, then once entered, the rest of the form will get all of the infomation on this property.

From here i would like to be able to edit the infomation and it will update back to the database.

i hope that i have explained this well enough for you to understand what i am trying to do,
any help would be verry much appriciated. :D

Re: Editing,deleating,adding records to a database from PHP

Posted: Wed Mar 17, 2010 9:58 am
by mikosiko
show the code that you have done so far and ask specific questions about it....

and search for examples.... there are plenty.

Re: Editing,deleating,adding records to a database from PHP

Posted: Wed Mar 17, 2010 10:22 am
by wanger220
Google search for "php mysql" and you'll find a number of tutorials to get you started. I followed two of those tutorials and had an events web site up and running in a few hours.

Re: Editing,deleating,adding records to a database from PHP

Posted: Wed Mar 17, 2010 10:26 am
by scorpio90
the code i have up to now is posted below, however i know at the moment it doesnt work at all this is just a idea that i had of what it may look like, if anyone can help this would be great :D


<?php require_once "myFunctions.php" ; ?>


<?php
getConnection();
$id = "48224-2391";
$SQL= "SELECT * FROM tbl_properties where post_area_code = $post_area_code" ;
$result = mysql_query($SQL);
$data = mysql_fetch_assoc($result);
?>

<form action="insertedit.php" method= "post">;

post/area_code:<input type= "text" value= "<?php echo $post_area_code;?>" </form>
address :<input type= "text" value= "<?php echo $address;?>"</form>
bedrooms:<input type= "text" value= "<?php echo $bedrooms;?>"</form>
bathrooms:<input type= "text" value= "<?php echo $bathrooms;?>"</form>
garage:<input type= "text" value= "<?php echo $garage;?>"</form>
city:<input type= "text" value= "<?php echo $city;?>"</form>
country:<input type= "text" value= "<?php echo $country;?>"</form>
state province:<input type= "text" value= "<?php echo $state_province;?>"</form>
exterior:<input type= "text" value= "<?php echo $exterior;?>"</form>
year built:<input type= "text" value= "<?php echo $year_built;?>"</form>

</form>
<form><input type="button" onclick=" post " value= " update"</form>