Page 1 of 1

Help

Posted: Wed Oct 05, 2011 10:43 pm
by jauson
Hi Guys,

I created a view and modify form.
table name: `t_board`
fields:

index <-- hidden
writer <-- on my form
subject <-- on my form
message <-- on my form
filename <-- on my form
dateRegister <-- hidden

when i click modify button in view form I need to see what data registered being modify by index. here's my script on modify form.

Code: Select all

$index=$_GET['index'];

$sql = "SELECT * FROM `t_board` WHERE index='$index'"; <---- not working Any help will be appreciated
$result = mysql_query($sql);

<? while($rows = mysql_fetch_array($result)){
?>

echo $rows['writer'];
echo $rows['subject'];
echo $rows['message'];
echo $rows['filename'];

Re: Help

Posted: Thu Oct 06, 2011 5:19 am
by social_experiment

Code: Select all

<?php
$result = mysql_query($sql) or die(mysql_error());
?>
The query itself won't report an error so you check for it when passing the query to mysql_query() by using the die() function. Add the example line into your script and paste the results back here :)

Tip: It helps to be thorough when asking for help, giving as much information about the error / problem usually results in a speedy solution to the problem or error.