Hi Friends, I am new to PHP world. I have 5 pages which is more data intensive. I need to open and do operation in mysql database. I am opening and closing db in all pages. Can you suggest me a good design so that I do not need to write my db script every time Thx
Sorry mate, your question wasn't very clear. What do you mean when you say you "have 5 pages" ? 5 php scripts or maybe 5 html pages generated from php? To save yourself writing the db script every time, just put into a function and use that.
Look up includes in the PHP manual. You can put your database code in one file, like db.php, and then have you other scripts include it, like: include("db.php"); PHP:
Generate a PHP files which contains database connections and then include that file in all your 5 pages.