The Daily Click ::. Forums ::. Non-Klik Coding Help ::. PHP - MySql db manipulation directly in .php files ?
 

Post Reply  Post Oekaki 
 

Posted By Message

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
23rd April, 2004 at 04:02:56 -

I have a website that uses php and mysql. I wanna make an admin section so i don't have to open Phpmyadmin everytime i wanna change something on my site. For this i need to know how to delete and add (maybe other stuff too) rows in a db from within the site itself, meaning from inside the .php files; maybe through a hyperlink or something.

Can anyone help ?

 
n/a

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
23rd April, 2004 at 06:14:00 -

you just do a standard mysql query to edit the table. you'll have to look up the exact syntax, it's:


mysql_query('ALTER TABLE `tablename` ADD `rowname` VARCHAR(255) NOT NULL;');


to add a row, etc.

Image Edited by the Author.

 
www.thenatflap.co.uk

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
23rd April, 2004 at 09:04:18 -

PhpMyAdmin is made in PHP, why not take a look at how that works? When you change something, it tells you the SQL query that it used

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
   

Post Reply



 



Advertisement

Worth A Click