|
Posted by Kimmo Laine on 02/23/06 10:20
"Lag" <lagoron@gmail.com> wrote in message
news:1140671438.716831.205800@u72g2000cwu.googlegroups.com...
> Having a problem updating my database from a web page, through a
> submission form. Can anyone help?
>
> ----THIS IS MY CODE IN update.php----(user, pass, and database are
> typed in directly, I changed them here for securiy reasons :) )
>
> <?php
>
> /*---CONNECT TO DATABASE---*/
>
> $conn = mysql_connect("localhost", "user", "pass") or
> die(mysql_error());
> mysql_select_db("database",$conn) or die(mysql_error());
>
> $event = $_GET["id"];
> $title=$_POST['title'];
> $date=$_POST['datetime'];
> $desc=$_POST['desc'];
>
> //---UPDATE ENTRY IN DATABASE---
> $query = "UPDATE 'calendar_events' SET 'event_title' = '$title',
> 'event_start' = '$date', 'event_shortdesc' = '$desc' WHERE 'id' =
> $event";
>
> //LIST ITEMS
> echo "$event $title $date $desc";
>
> mysql_query($query)
put:
or die(mysql_error());
here and see what the problem is.
Debugging is a difficult skill to learn.
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|