Re: [phplib] Shared server help for PHPLIB and mySQL From: Brant Smith (bsmith <email protected>)
Date: 06/26/01

Hi Nathan,

Thank you SO much for your suggestions. Comments/follow-up
are below.

I think it would outstanding for someone to create a how-to page
for people setting up PHPLIB on shared servers where they do not
have access to .htaccess or any of the server/php configs/inits.
I know there's a good shared server how-to out there (by James?)
but it assumes you can fiddle with .htaccess.

This how-to would assume that the person installing PHPLIB would
ONLY be able to affect things through the actual php files via
ini_set(), includes and even for creating/dropping SQL tables (i.e.
there's no access to phpMyAdmin or the mySQL command line
utility).

This would be the 100% common denominator installation procedure
since it should work with all systems (as long as they have a later
version of PHP that supports ini_set() and other later-version functions).

I'd do it myself, but I am way too green and wouldn't want to screw
up other newbies. Lots of people have suggested changing ISPs and
we might do that for future jobs, but on this one, I need to stay where
I'm at.

Anyway, comments and stuff below......

>
>You're on the right track, Make sure that in prepend.php3 the line that
>says $_PHPLIB["libdir"] is set to the path (with trailing /) of your
>phplib files.

Done. Thanks.

>
>> 2) I cannot create or edit .htaccess files. Boy that would
>> make life easy. But they will not do so.
>>
>
>Yes, as turning off gpc_magic_quotes would be a nice thing, as well as
>enabling track_vars. I think ini_set(0 was mentioned, which would work as
>well, provided you're not in a safe_mode environemnt.

I'll check with the ISP re: safe_mode. What are the
settings I should set with ini_set()?

gpc_magic_quotes = off
track_vars = on

what else? and where do I put this ini_set() command?
Can I just put it in local or prepend and leave it at
that? I assume I'll still have to include (prepend.php) into
all the php files, right?

More below....

>
>> 3) I do not have telnet access to create mysql databases
>> and tables. I have a mysql database and I've been able to
>> use a poorly functioning phpMyAdmin to create the tables
>> but I can't edit them table structure once created. I
>> can add, edit and delete records with no problem via php
>> and have done so. My "helpful" ISP said that I should be
>> able to create/modify tables from a PHP script, but I've
>> never done this and don't know how.
>>
>
>subclass your database and access it with the subclass:
>
>class MyNewDB extends DB_Sql {
> var $user = ""
> var $database = ""
> ...
>}
>
>Then just do stuff like this:
>$db = new MyNewDB;
>$create_clause = "CREATE TABLE myTable <some table structure>");
>$db->query($create_clause);
>
>You'll get an error of your clause is incorrect, I'm not sure what the
>return value in php is of a CREATE statement (anyone?) nuw_rows and
>affected_rows will return "0". mysql_result may be the answer?

Interesting. You're suggesting that I create the table
structure via the files. Scary thought indeed. Anyway,
I'm VERY new to OOP, so where do I find out what
variables I need to set for DB_Sql? I assume this is
a PHPLIB object......oh gawd I'm a newbie.

I also assume I'll be just running this file once to
create the file and then whenever I need to modify
the table structure. Right?

Thanks in advance,
Brant

-- 

precision custom engineering for the web http://www.antecode.com/

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>