Click to See Complete Forum and Search --> : need help with posting data from form ...


imarockstar
09-25-2005, 05:52 PM
ok I am trying to insert some data into my nifty little db ... but i think i have the php wrong ... all i want to do is insert a new row into the 'venue' table ...

is this correct ... or am i missing somthing ...


<?php

$query = "INSERT INTO `venue`
( `v_pic` , `v_name` , `v_website` , `v_address` , `v_email` , `v_phone` , `v_rating` , `v_style` , `v_desc` , `v_id`)";
$result = mysql_query($query);

?>


<form action="<?php echo $result;?>" method="post">
<input name="v_id" type="hidden" value="0">

Venue Name <input name="v_pic" type="text">
Venue Website <input name="v_website" type="text">
Venue Address <input name="v_address" type="text">
Veue Email <input name="v_email" type="text">
Venue Phone <input name="v_phone" type="text">
Venue Rating <input name="v_rating" type="text">
Venue Style <input name="v_style" type="text">

Venue Description
<textarea name="v_desc" cols="25" rows="10"></textarea>

<input type="submit" name="Submit" value="Submit" />

</form>

Weedpacket
09-25-2005, 10:28 PM
$query = "INSERT INTO `venue`
( `v_pic` , `v_name` , `v_website` , `v_address` , `v_email` , `v_phone` , `v_rating` , `v_style` , `v_desc` , `v_id`)"; So you're saying to the database "Insert into these fields...." and listing "v_pic", "v_name" and so on. But insert what?

Read up on MySQL's INSERT syntax.

goldbug
09-26-2005, 12:30 AM
Do not multi-post please.

http://www.phpbuilder.com/board/showthread.php?t=10309157