Hi there! Thanks for all the help so far. When my boss said I should be up to date as soon as possible, he meant last week. So I got a good rollicking when I came to work. Nice way to start my day....
Back to my problem:
I have a Text in Mysql: The code for fetching it in php is:
[PHP]
$id = intval( mysql_real_esca pe_string( $_GET['id'] ));
$query = "SELECT * FROM jos_issues WHERE jos_issues.cont entid= '$id' ORDER BY text desc";
$result = mysql_query($qu ery);
while($row= mysql_fetch_arr ay($result)) {
echo"$row[text]<BR>";
}
[/PHP]
What I am looking for is a way to
a) press a link for update
b) dynamically print out a form for doing that.
All I am after is a way to edit and delete all the texts that are in my database. They are all linked to a content $id. So my table looks like this: id | text | contentid
I tried this code, but all I get is a very blank page with nothing on:
[PHP]<? include("c:/db.inc"); error_reporting (E_ALL);
ini_set('displa y_errors', '1');
//$id = intval( mysql_real_esca pe_string( $_GET['id'] ));
$id = 12; echo "id = $id";
$query = "SELECT * FROM jos_issues WHERE jos_issues.cont entid= '$id'";
$result = mysql_query($qu ery);
$num = mysql_numrows($ result);
//mysql_close();
$i = 0;
while($i<$num) {
$text = mysql_result($r esult,$i,"text" );
<form action="updated .php" method="post">
<input type="hidden" name="ud_id" value="<? echo $id; ?>">
Text: <input type="text" name="ud_text" value="<? echo $text; ?>"><br>
<input type="Submit" value="Update">
</form>
++$i;
}
?>[/PHP]
Let me know if you can help me with this one. There's no lunch for me today. I have to have finished at one o' clock, or I am screwed...
Thanks in advance.
Phopman
Back to my problem:
I have a Text in Mysql: The code for fetching it in php is:
[PHP]
$id = intval( mysql_real_esca pe_string( $_GET['id'] ));
$query = "SELECT * FROM jos_issues WHERE jos_issues.cont entid= '$id' ORDER BY text desc";
$result = mysql_query($qu ery);
while($row= mysql_fetch_arr ay($result)) {
echo"$row[text]<BR>";
}
[/PHP]
What I am looking for is a way to
a) press a link for update
b) dynamically print out a form for doing that.
All I am after is a way to edit and delete all the texts that are in my database. They are all linked to a content $id. So my table looks like this: id | text | contentid
I tried this code, but all I get is a very blank page with nothing on:
[PHP]<? include("c:/db.inc"); error_reporting (E_ALL);
ini_set('displa y_errors', '1');
//$id = intval( mysql_real_esca pe_string( $_GET['id'] ));
$id = 12; echo "id = $id";
$query = "SELECT * FROM jos_issues WHERE jos_issues.cont entid= '$id'";
$result = mysql_query($qu ery);
$num = mysql_numrows($ result);
//mysql_close();
$i = 0;
while($i<$num) {
$text = mysql_result($r esult,$i,"text" );
<form action="updated .php" method="post">
<input type="hidden" name="ud_id" value="<? echo $id; ?>">
Text: <input type="text" name="ud_text" value="<? echo $text; ?>"><br>
<input type="Submit" value="Update">
</form>
++$i;
}
?>[/PHP]
Let me know if you can help me with this one. There's no lunch for me today. I have to have finished at one o' clock, or I am screwed...
Thanks in advance.
Phopman
Comment