Hallo !!
So look at this image :
http://img194.imageshack.us/img194/8272/snapshot5f.png
This table prints the titles of entries from a table in a database.. The code that i use for this table is this :
Code: [Select]<!--Table For Deleting and Updating -->
<p align="center"><font color="#1569C7">DeleteOrEdit(</font><font color="red">Security Projects & Thoughts Section</font><font color="#1569C7">);</font></p>
<table align="center" border="2" bordercolor="green" cellspacing="0">
<!--First row with title delete and edit-->
<tr>
<td><font color="#F87217">Title:</td>
<td><font color="#F87217">Delete();</font></td>
<td><font color="#F87217">Edit();</font></td>
</tr>
<?php
$query = 'SELECT title FROM site_entries ORDER BY date_entered DESC';
if ($r = mysql_query($query)){
while ($row = mysql_fetch_array($r)){
print "<tr>
<td><font color="#8BB381">{$row['title']}</td>
<td><form method="post" name="sub_del"><input type="submit" value="Delete();"></form></td>
<td><form method="post" name="sub_edt"><input type="submit" value="Edit();"></form></td>
</tr> ";
}
}else{
die('<p>Could not retrive the data brcause:<b>' . mysql_error .'</b> The query was $query.</p>');
}
mysql_close();
?>
</table>
Its simple...till here...
Now i stack on how to make the script that will delete the registers of the database...I can think something with id column but i can't make it true...:s I want you to help me giving me ideas on how to make this or any other idea on how to create an delete/edit page...If you think that i start it with a wrong way please tell me
The table name is site_entries and its columns are id , title , entry , date_entered
Thanks
Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO principles. I've started reading OOP tutorials including the design patterns. And John is right, this
mysql_real_escape_string making variable equal nothing
i post a form and i post the variable:Code: $var = $_POST[variable];then i echo $var its what i submitted the variable to be. then i add the mysql_real_escape_string() function to itspell it correctly
$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable, but it doesn't work:Code: $test = array(1,2);$num = "[0]";echo $test{"$num"};
HELP with mysql_real_escape_string
I'm looking to remove apostrophes completely when someone enters lyrics but don't have a clue how to do it.I've attached the 'submit lyric' page and the page where I approve submitted lyrics.(they're
problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mine, i grabbed it from here http://www.phpfreaks.com/tutorial/basic-paginationNow onto the
Gerenate tabel in Php
I whant to generate a tabel takeing data from database like this one so the results to be display on 2 columns<table width="50%" border="0" cellspacing="0"
storing video files into mysql in php
hi i have my video files in my folder ,i have to store the path of the videos into db and the play it in the player from the database.thanking in advance
Good Programming and Web Design Books
Hi, I recived a pm today from a fellow phpfreaker regarding php books, i replied with the following, it may be of help to php peeps that are looking for a good book but are unsure of what to
Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo friendly links.The code that ive used many times before.....Code: $_SESSION['lang'] = $lang =
Parse Error Help
Hello, I got the parse error "Parse error: syntax error, unexpected ',' in register.php on line 21Heres the code:Code: <body