You are here: Re: Create Mysql database? « PHP Programming Language « IT news, forums, messages
Re: Create Mysql database?

Posted by Jon Slaughter on 05/11/07 19:35

"Jon Slaughter" <Jon_Slaughter@Hotmail.com> wrote in message
news:Yx31i.5528$H_.1648@newssvr21.news.prodigy.net...
>
> "harvey" <harvey.zzz@blueyonzders.com> wrote in message
> news:MPG.20aebae984edb64e98999d@news-text.blueyonder.co.uk...
>> In article <1178903815.663966.110230@y80g2000hsf.googlegroups.com>,
>> matt.farey@gmail.com says...
>>> remember though that it's considered good practise not to have php
>>> use root, give php too many permissions and it will only be time
>>> before your hard work comes back to haunt you, instead get use
>>> to creating the db using the mysql command line (or some helpful gui)
>>> and then immediately create a new user which has rights over this
>>> database, and plug that into the php scripts that use that db,
>>> limiting potential for disaster.
>>>
>>>
>>
>> hmmm... I can see that this is likely to get very complicated very
>> quickly.
>>
>> My difficlty is I am at the learning stage with PHP and mySQL but I'm
>> doing this to try and automate the procedures for someone who knows even
>> less than I do. I need it to create the database and tables and
>> then update the tables for him from forms in his browser -
>>
>> I can do most of it but the PHP/Mysql is new to me as I said.
>>
>> I've bought the Samms PHP,MYsql and Apache - All in One book and am
>> working through it to get this done but it tends to gloss over
>> or even ignore the really important stuff such as that you just
>> mentioned. I'm reasonably Linux oriented so most of it makes sense but
>> where issues don't arise at all I can miss them. (I'm not at all
>> impressed with most of the books I've seen I must admit but this one did
>> seem the best)
>>
>> Do you have any advice for me on using PHP to create the database appart
>> from not doing it? (I suspect he doesnt have root access on his web site
>> either so I'm guessing he needs to use his own ISP provided access - he
>> does have the mySQL admin package but not the skills to use it -)
>>
>> Is there anything I can do to limit the problems of creating the database
>> in PHP? I really don't want to try and get him to do anything manually.
>>
>>
>>
>
> Its actually quite easy. I too haven't done much in it but I'm pretty much
> able to do all basic database stuff I need to.
>
> Essentially you first log into the database using a function, create a sql
> query string(which is probably going to be the hardest part but it too is
> quite simple once you get over the mental block), and then query the
> database with another function.
>
> for example, heres a query for my database to check some stuff
>
> $query="DELETE FROM ips WHERE ip='".mysql_real_escape_string($RMADDR,

BTW, the mysql_real_escape_string is used any time the data your sticking
into the database might be used for sql injections. This is where they can
mess whith your query to change it to something else and screw up your
database or get its data. I just wrap it around every variable that I use
just incase.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация