Re: [PHP] How to connect Web database

2002-10-06 Thread Intruder

You have to use mysqldump utility to make script, then you can put it into your
PHP script and run that script:
";
mysql_query($sql);
?>

or just dump your database directly to remote server by running mysqldump with
parameters Host and some other. The only difficulty could be, that remote
provider could reject all emote connections :((

the third way is to place PHP script on remote mashine and to connect to your
local MySQL server and just make some SELECT-INSERT. Here you can have the same
problem as in previous: proveder can reject all connection aoutside their box
:(((


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mysql_fetch_row() problem

2002-10-06 Thread Intruder

ttc> $get_anames = mysql_query("SELECT `name` FROM `artists` WHERE `artist_id` =
ttc> '$id'");
ttc> $anames = mysql_fetch_row($get_names);// !!! ERROR LINE !!!

of course it is an error! check your spelling !!!
$get_names != $get_anames ;


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] REMOTE_ADDR in requied files

2002-01-04 Thread Intruder

>> When I call function stored in another file, included with require
>> command, variable $REMOTE_ADDR is empty in this function. How is that
>> possible?? Thanks for help.

function Funcname() {
global $REMOTE_ADDR;

...funcbody...
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Checking for characters in string

2002-01-04 Thread Intruder

>> Whats the most compact way to do this? substr? ereg?

I think regular expressions is the best way because working with strings
looks like this:

if ($strtolower($pass)!=$pass) && ($strtoupper($pass)!=$pass) {
  echo "OK!";
} else {
  echo "WRONG!";
}

but using reg expr it's even more shorter



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sending variables between PHP pages

2002-01-04 Thread Intruder

>> how can I send a connection database variable, from one PHP page to other
>> PHP page, and maintance the database connection open during both pages?

I don't think one can do that. There is NO need for that. You can write
header.php file and
include it in the beginning of each PHP page where you need db connection
and footer.php
which you can include at the bottom of each page with X_close() function
in it.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sending variables between PHP pages

2002-01-04 Thread Intruder

>> Yes, thanks a lot, but i need to mantain the connection open for manage a
>> transaction, an everytime that I open a new database connection,
>> the system
>> begins a new transaction and I lose the last one.
>> Do you understand, me?
>> Do you know the way for do that?

I think it is imposimble in web applications at all, because there is no
persistent connection between db server
and "web server + PHP" service. You can try for example mysql_pconnect()
function (or it's analog for your db engine)
but still I don't think it is possible ;(((
Only applications can make this for you NOT PHP and Web ;(((



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] Form Problem

2002-01-09 Thread Intruder

I don't like this line:

change it:


to my mind it could help ;




PK> 
PK>   
PK>   My Form
PK>   
PK>   
PK>   

PK>   My name is:
PK>

PK>   
PK>   
PK>   
PK>   



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Change column in mysgl

2002-01-15 Thread Intruder


>> Can I change this column "adress VARCHAR(25)"
>> to "adress VARCHAR(40)" afterwards.
>> I use mysql.
>> Thanks for any help



RTFM "ALTER TABLE..."



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Display a mesagge and redirect (newbie)

2002-01-17 Thread Intruder

>> a) run a mysql query
>> b) display a simpe message
>> c) delay few seconds
>> d)auto redirect to a page





 some message goes here !!!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Display a mesagge and redirect (newbie)

2002-01-17 Thread Intruder

>> No good, since  starts counting when page is first opened, so
>> clients with slow connection might not never see the message. I'd rather
>> use


what do you mean "slow connection" ??? 10 bytes/second ???
I don't think that someone has such speed and to load your code
slow-connected person will have to wait more than 5 seconds and even more
longer than to load just blank page with my META :))


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Checking database for a value

2002-04-20 Thread Intruder

DLM> I have a field userid which the user fills in at registration. Before
DLM> entering the data into the database, I want to check if the userid exists in
DLM> the database.


You have to SELECT that user from the table you store your users:
SELECT userid, name , etc FROM table WHERE userid='$your_id'
if *_num_rows() > 0 then he is already in, otherwise you can add him:
INSERT . INTO table 

Enjoy!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] getting data from form...

2001-10-18 Thread Intruder

TM> I have file .

TM> index.php3 a form in it ...

TM> 
TM> 
TM> 

TM> and how to make it that form.php3 will read all the data that was submitted
TM> (i'm mean the name and the value)


do you mean :

reset($HTTP_POST_VARS);
while (list ($name, $value) = each($HTTP_POST_VARS)) {
  proceed with them
  e.g.
  if ($name=="Steak") {
echo "Variable name: ".$name." equals to ".$value;
  };
  if ($name=="XYZ") {
echo "Variable name : ".$name." and it's value is ".$value;
  };
  ...
};

Put this code whereever you want to process your submited form
Note that you haven't  on your form, but in most cases it's
necessaey to have it (exept some JavaScript was added).



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]