Re: [PHP] Add a record and recover it's ID in one operation

2003-02-13 Thread Daniel Page
Thanks! I stand corrected. I'll check the PHP online manual more often, and for now, I'm off to optimise my database and rewrite a few queries :) Cheers, Daniel "Leif K-Brooks" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > www.php.net/my

[PHP] Add a record and recover it's ID in one operation

2003-02-13 Thread Daniel Page
Hi, Imagine a table with an auto-increment id number field and a text field for the username. User B (with user name 'johnny') could write to the database a millisecond after user A, with the same username. When user A looks for the last record written by Johnny, A will find the record entered by

[PHP] Re: MySQL for storing PHP code

2003-02-10 Thread Daniel Page
Thanks for the comments everyone! eval() has just made my day :) Cheers, Daniel "Daniel Page" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Hi, > > Would it be possible to store PHP code in a MySQL table, then via a web > page, connect to t

[PHP] MySQL for storing PHP code

2003-02-10 Thread Daniel Page
Hi, Would it be possible to store PHP code in a MySQL table, then via a web page, connect to the DB, recover the code that corresponds to a certain id number, then include that code for execution? For example (quick, dirty, and untested!): $sql = "SELECT phpcode FROM phpstorage WHERE codeid = 1"

Re: [PHP] Re: Protecting include files

2003-02-07 Thread Daniel Page
> I have used a few different Web hosting companies, and I > have never seen a case where my home directory was my > document root. I have always had a directory like > public_html/ or www/ that was my personal document root, so > as long as I don't place files in there, they are not > accessible v

[PHP] Limit the amount of returns in a MySQL query

2003-02-07 Thread Daniel Page
Hi All, Imagine I have a giant database table tracking email addresses (I don't but it is the first example that jumps to mind after my recent antispam campaign!). If i do a select * from mailaddresses; I will get all of the table. If i do a select * from mailaddresses where id < 10; I will get

[PHP] Re: How to insert time and date into mysql?

2003-02-07 Thread Daniel Page
The easiest way is to create a timestamp field (see manual depending on how you want to store the date, as you can go from to ddmmhhmmss...), and when you create your DB update query, use now(). for example, update a field with a new email address, and the user's current ip with the time

[PHP] Re: Protecting include files

2003-02-07 Thread Daniel Page
If someone wants to call your .inc file like http://www.my.site/lib.inc they will see the code, as it is a text file. OK, we all know that. As the .inc file is in reality a renamed php script, containing variables, functions, etc, if you call it .php instead of .inc, it will be parsed by PHP, but

[PHP] Re: Script under Windows OK, under Linux, not...

2003-01-25 Thread Daniel Page
It could be somthing to do with my hoster running Linux in Safe Mode... I am not sure what this could entail, so I'll keep looking. Again, if anyone has any info, it would be appreciated!!! Cheers, Daniel "Daniel Page" <[EMAIL PROTECTED]> a écrit dans le message news: [

[PHP] Script under Windows OK, under Linux, not...

2003-01-25 Thread Daniel Page
Hi, I have the following code : $_fp = fopen("/home/dh2240/mgt/index.php", "a+") or die(); $_contents = fread($_fp,filesize("/home/dh2240/mgt/index.php")); fclose ($_fp); //Menu elements $_sme = strpos("$_contents","sub_menu_elements"); echo "sme = $_sme"; ... It should display somthing like "sm