June 11th, 2000, 04:14 AM
I have been wonderig if any one can help me in creating a database driven web site for making free ads but only the owner can delete their own ad or the admin.
If someone can just tell me the logic and I will take it from there, (im very newbie to this mysql and php)
This is what i know,
I can create via my web page an empty databse in mysql. Though i dont know how to populate it. I can connect to it via telenet but I dont know any commands or so in making tables via telenet.
Im aware of the phpadmin for mysql that lets one create table and row n what not... I installed it but it wont seem to work but nevermind I will work on trying to make that work,
Now when this datase is done I would want the user to be able to delete their own add if they wanted to via their user name and password which they gona have to have by registering first with a form. so I think for this matter only (pass and login) there will need to be a separate table rite? or can it be just added on to one table for this overall purpose.
and lastly how would i query this database using the php language.
Thanks a lot,
June 11th, 2000, 05:37 AM
1. well.. take a look at http://hotscripts.com/PHP/Scripts_and_Programs/
They've got a few ad management scripts there.. perhaps they can help you write your own?
You can use the mysql_query php function, but before you do that.. you will need to connect to the database, using mysql_connect and mysql_select_db.
An example would be,
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
$db = mysql_connect ("localhost","username", "password");
$result = mysql_fetch_array(mysql_query("SELECT * FROM index WHERE id = $id"));
DevShed and webmonkey's got a few tutorials that you can follow..