[PHP-DB] How to get mysqli to allow SQL-based User-Defined Variables as column aliases?

2021-06-10 Thread Philip Schlesinger
Hi all,

I’m able to get mysqli to set a user-defined variable and the use it later on 
either in a column value definition or a conditional, I.e. (semi-pseudocode 
since I’m not in front of my work computer)

First do mysqli $conn->query(‘Set @foo = “bar”;’);
…which will prepare the database session with the variable.

Then do a $stmt = $conn->stmt_init()

Then do a $stmt->prepare(‘Select @foo as “baz”;’);

Finally do a $stmt->execute();

That results in:

‘baz’
———
“bar”


_however_ if I want to use a SQL user-defined variable as a column alias, 
mysqli throws an error.  This does not work:

$conn->query(‘set @acolname = “aCol”;’);

$stmt = $conn->stmt_init()

$stmt->prepare(‘Select “data” as @acolname;’);

$stmt->execute();

If I ran the straight SQL in a SQL application, making the select statement a 
variable as well, and did a prepare and execute, it would work just fine

Mysqli however throws an error with the column alias being a SQL user-defined 
variable.

Help?

Get Outlook for iOS


[PHP-DB] How to use mysqli with php5.6

2016-06-12 Thread stevens
Hi,
I have installed php5.6 by command "pkg install php-56“ in solaris 11 x64,and I 
want to use mysqli extension to connect mysql 5.5 database,but I found that I 
can’t find any mysqli extension.Any one can tell me how to use mysqli 
extension?Any suggestions should be appreciated!
   stevens




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



[PHP-DB] How to get stored procedure return values via PDO (in 2011)?

2011-09-14 Thread Hauke Stange
Hi there,

I just stumbled upon the problem regarding the return values of mysql
stored procedures via PDO. In my case I use Zend_Db_Adapter_Pdo_Mysql
but hence this is an adapter I still blame PDO. ;-)

Some times ago (in 2007) this problem was discussed already:
http://marc.info/?l=php-general&m=118545433122314

Even as bogus bug report this problem raised:
http://pecl.php.net/bugs/bug.php?id=6565

>From those Links I got my actual workaraound.

Does anyone of you know if there is a final solution for this problem or
a better workaround at least?

Regards,
Hauke


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



[PHP-DB] How to have a smooth hairless skin

2011-09-03 Thread How to have a smooth hairless skin
How to have a smooth hairless skin. 
   Hairless in the bikini zone.
Click  here:
 
   http://www.removehair.tk


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



Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-23 Thread Karl DeSaulniers

Hi Ron,
I personally don't believe in syncing peoples personal contacts to  
anyones server.

Especially google. If that is what that API does. But your call.
You should be able to connect to the contact sync right on the phone  
with your app

and not need a server to do this.

On the jailbreaking note, didn't the US government deem it not  
illegal to jailbreak your phone?
I know there are a lot of us. Me included. Its just a better  
experience, IMO.
Nothing to be said about how apple will treat it, but I know they  
have been adopting
a lot of things that jailbroken apps created back in the day in the  
iOS now like, copy an paste and tether. lol

If you don't believe me, look up clippy. :)
I had copy an paste in iOS 2.1 and could use my tether app for  
connecting my computer then too.
Tether is something that hasn't been in the approved apps till iOS 3  
or 4. It was actually frowned upon by Apple.
Its only a matter of time, I think, before they allow JB apps in  
iTunes anyway.


search for CYDIA, CYCONTACT, iSQL(I think thats the name), and  
LockCalendar.

They do all that your talking about already. They are jailbroken apps.
But for instance, I have modified my LockCalendar app with my own  
graphics.
Pretty cool. You may be able to find info on how to build your app  
from them, not that yours
would be necessarily a jailbroken app, but the code to build them  
would be the same for the most part.

HTH,

Best,
Karl

On Oct 23, 2010, at 4:17 PM, Andrés G. Montañez wrote:


Hi Ron,
yes,you should try to use Google as a gateway; the Google API is very
well documented,
I think all you need is just the user account (and password) and then
through the API you should access all data.

Cheers.

On 23 October 2010 19:10, listread  wrote:

Andrés,

It would be tempting to build an app for this, but we don't have a  
single

Mac in the place.

Maybe syncing with Google is the way to go?  That would keep the  
iPhone out

of the equation.  (This is not intended for the market.)

Thanks,

- Ron

On 10/23/2010 2:16 PM, Andrés G. Montañez wrote:


Hi Ron,
watchout with the jailbrake becaous it will void your warranty over
the iphone. If you want to sync the phone's contact with  
"something",
you really should check the iphone API and build an iphone  
application

which hooks and listens for contact's change and then notify the
changes to your server.
I know building an iphone app is a pain, but I think its the  
right way

to do it, if not the only.
Is this need for a hobbie or you need to implement this for a public
application?

Cheers.

On 23 October 2010 13:57, listread  wrote:



Karl / Andrés

Thanks for your replies.

iMy appears to be only a client and I can already access servers  
with php

on
the iPhone web browser.

I would like MySQL on my iPhone.  There was a way to make a  
jailbroke

iPhone
a MySQL server, but I'm not sure it is available any longer.

My immediate desire is to sync the iPhone's native contacts and,  
perhaps,
the calendar with our online server over the internet.   
Preferably syncs

would be "pushed".

With a Google Gmail account, you can already do just exactly  
that.  Once

set
up, if you update your Gmail contacts, a minute or two later  
your iPhone
contacts will be sync'd.  It's supposed to work with the Google  
calendar,

too, but I haven't tried it.  It appears that Google is using a MS
Exchange
Server or similar.  The setup in the iPhone uses the Exchange  
server

settings.  See http://www.google.com/mobile/sync/

The solution I'm looking for would be server side -- if not  
completely,

in
part.   Again, it would be best to sync directly to the iPhone,  
but if

the
server would sync with the Google calendar and Google sync'd  
with the

iPhone, that would be an acceptable 2nd choice.

Thanks again for your reply!

- Ron




On 10/23/2010 5:47 AM, Andrés G. Montañez wrote



Hi Ron, what's what you want to sync? Contacts? Or everything  
else?

You want to sync it over the internet? Or over wire?
You should research the iPhone API/SDK for sync;
and not focus with MySQL, wich is just an storage.

Cheers.

On 23 October 2010 03:09, Karl DeSaulniers
 wrote:




I believe there is a MySQL for the iphone
iMy?

http://forums.mysql.com/read.php?58,249718,249718

You'd probably want o use JASON or an equiv. to talk back and  
forth

with
your database and app.
At least thats the consensus I'm finding on posts about it.

HTH
Karl

On Oct 22, 2010, at 11:21 PM, listread wrote:





Hey all!

Does anyone know how to go about syncing a MySQL db with an  
iPhone

over
the internet?

An alternative would be syncing with Google Contacts, which  
then could
sync with the iPhone.  I think Google Contacts uses Exchange  
Server to

sync
with devices.

Thanks!

- Ron



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





Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
T

Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-23 Thread Andrés G . Montañez
Hi Ron,
yes,you should try to use Google as a gateway; the Google API is very
well documented,
I think all you need is just the user account (and password) and then
through the API you should access all data.

Cheers.

On 23 October 2010 19:10, listread  wrote:
> Andrés,
>
> It would be tempting to build an app for this, but we don't have a single
> Mac in the place.
>
> Maybe syncing with Google is the way to go?  That would keep the iPhone out
> of the equation.  (This is not intended for the market.)
>
> Thanks,
>
> - Ron
>
> On 10/23/2010 2:16 PM, Andrés G. Montañez wrote:
>>
>> Hi Ron,
>> watchout with the jailbrake becaous it will void your warranty over
>> the iphone. If you want to sync the phone's contact with "something",
>> you really should check the iphone API and build an iphone application
>> which hooks and listens for contact's change and then notify the
>> changes to your server.
>> I know building an iphone app is a pain, but I think its the right way
>> to do it, if not the only.
>> Is this need for a hobbie or you need to implement this for a public
>> application?
>>
>> Cheers.
>>
>> On 23 October 2010 13:57, listread  wrote:
>>
>>>
>>> Karl / Andrés
>>>
>>> Thanks for your replies.
>>>
>>> iMy appears to be only a client and I can already access servers with php
>>> on
>>> the iPhone web browser.
>>>
>>> I would like MySQL on my iPhone.  There was a way to make a jailbroke
>>> iPhone
>>> a MySQL server, but I'm not sure it is available any longer.
>>>
>>> My immediate desire is to sync the iPhone's native contacts and, perhaps,
>>> the calendar with our online server over the internet.  Preferably syncs
>>> would be "pushed".
>>>
>>> With a Google Gmail account, you can already do just exactly that.  Once
>>> set
>>> up, if you update your Gmail contacts, a minute or two later your iPhone
>>> contacts will be sync'd.  It's supposed to work with the Google calendar,
>>> too, but I haven't tried it.  It appears that Google is using a MS
>>> Exchange
>>> Server or similar.  The setup in the iPhone uses the Exchange server
>>> settings.  See http://www.google.com/mobile/sync/
>>>
>>> The solution I'm looking for would be server side -- if not completely,
>>> in
>>> part.   Again, it would be best to sync directly to the iPhone, but if
>>> the
>>> server would sync with the Google calendar and Google sync'd with the
>>> iPhone, that would be an acceptable 2nd choice.
>>>
>>> Thanks again for your reply!
>>>
>>> - Ron
>>>
>>>
>>>
>>>
>>> On 10/23/2010 5:47 AM, Andrés G. Montañez wrote
>>>

 Hi Ron, what's what you want to sync? Contacts? Or everything else?
 You want to sync it over the internet? Or over wire?
 You should research the iPhone API/SDK for sync;
 and not focus with MySQL, wich is just an storage.

 Cheers.

 On 23 October 2010 03:09, Karl DeSaulniers
  wrote:


>
> I believe there is a MySQL for the iphone
> iMy?
>
> http://forums.mysql.com/read.php?58,249718,249718
>
> You'd probably want o use JASON or an equiv. to talk back and forth
> with
> your database and app.
> At least thats the consensus I'm finding on posts about it.
>
> HTH
> Karl
>
> On Oct 22, 2010, at 11:21 PM, listread wrote:
>
>
>
>>
>> Hey all!
>>
>> Does anyone know how to go about syncing a MySQL db with an iPhone
>> over
>> the internet?
>>
>> An alternative would be syncing with Google Contacts, which then could
>> sync with the iPhone.  I think Google Contacts uses Exchange Server to
>> sync
>> with devices.
>>
>> Thanks!
>>
>> - Ron
>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>



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



-- 
Andrés G. Montañez
Zend Certified Engineer
Montevideo - Uruguay

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



Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-23 Thread listread

Andrés,

It would be tempting to build an app for this, but we don't have a 
single Mac in the place.


Maybe syncing with Google is the way to go?  That would keep the iPhone 
out of the equation.  (This is not intended for the market.)


Thanks,

- Ron

On 10/23/2010 2:16 PM, Andrés G. Montañez wrote:

Hi Ron,
watchout with the jailbrake becaous it will void your warranty over
the iphone. If you want to sync the phone's contact with "something",
you really should check the iphone API and build an iphone application
which hooks and listens for contact's change and then notify the
changes to your server.
I know building an iphone app is a pain, but I think its the right way
to do it, if not the only.
Is this need for a hobbie or you need to implement this for a public
application?

Cheers.

On 23 October 2010 13:57, listread  wrote:
   

Karl / Andrés

Thanks for your replies.

iMy appears to be only a client and I can already access servers with php on
the iPhone web browser.

I would like MySQL on my iPhone.  There was a way to make a jailbroke iPhone
a MySQL server, but I'm not sure it is available any longer.

My immediate desire is to sync the iPhone's native contacts and, perhaps,
the calendar with our online server over the internet.  Preferably syncs
would be "pushed".

With a Google Gmail account, you can already do just exactly that.  Once set
up, if you update your Gmail contacts, a minute or two later your iPhone
contacts will be sync'd.  It's supposed to work with the Google calendar,
too, but I haven't tried it.  It appears that Google is using a MS Exchange
Server or similar.  The setup in the iPhone uses the Exchange server
settings.  See http://www.google.com/mobile/sync/

The solution I'm looking for would be server side -- if not completely, in
part.   Again, it would be best to sync directly to the iPhone, but if the
server would sync with the Google calendar and Google sync'd with the
iPhone, that would be an acceptable 2nd choice.

Thanks again for your reply!

- Ron




On 10/23/2010 5:47 AM, Andrés G. Montañez wrote
 

Hi Ron, what's what you want to sync? Contacts? Or everything else?
You want to sync it over the internet? Or over wire?
You should research the iPhone API/SDK for sync;
and not focus with MySQL, wich is just an storage.

Cheers.

On 23 October 2010 03:09, Karl DeSaulnierswrote:

   

I believe there is a MySQL for the iphone
iMy?

http://forums.mysql.com/read.php?58,249718,249718

You'd probably want o use JASON or an equiv. to talk back and forth with
your database and app.
At least thats the consensus I'm finding on posts about it.

HTH
Karl

On Oct 22, 2010, at 11:21 PM, listread wrote:


 

Hey all!

Does anyone know how to go about syncing a MySQL db with an iPhone over
the internet?

An alternative would be syncing with Google Contacts, which then could
sync with the iPhone.  I think Google Contacts uses Exchange Server to
sync
with devices.

Thanks!

- Ron



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


   

Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



 



   


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


 



   



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



Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-23 Thread Andrés G . Montañez
Hi Ron,
watchout with the jailbrake becaous it will void your warranty over
the iphone. If you want to sync the phone's contact with "something",
you really should check the iphone API and build an iphone application
which hooks and listens for contact's change and then notify the
changes to your server.
I know building an iphone app is a pain, but I think its the right way
to do it, if not the only.
Is this need for a hobbie or you need to implement this for a public
application?

Cheers.

On 23 October 2010 13:57, listread  wrote:
> Karl / Andrés
>
> Thanks for your replies.
>
> iMy appears to be only a client and I can already access servers with php on
> the iPhone web browser.
>
> I would like MySQL on my iPhone.  There was a way to make a jailbroke iPhone
> a MySQL server, but I'm not sure it is available any longer.
>
> My immediate desire is to sync the iPhone's native contacts and, perhaps,
> the calendar with our online server over the internet.  Preferably syncs
> would be "pushed".
>
> With a Google Gmail account, you can already do just exactly that.  Once set
> up, if you update your Gmail contacts, a minute or two later your iPhone
> contacts will be sync'd.  It's supposed to work with the Google calendar,
> too, but I haven't tried it.  It appears that Google is using a MS Exchange
> Server or similar.  The setup in the iPhone uses the Exchange server
> settings.  See http://www.google.com/mobile/sync/
>
> The solution I'm looking for would be server side -- if not completely, in
> part.   Again, it would be best to sync directly to the iPhone, but if the
> server would sync with the Google calendar and Google sync'd with the
> iPhone, that would be an acceptable 2nd choice.
>
> Thanks again for your reply!
>
> - Ron
>
>
>
>
> On 10/23/2010 5:47 AM, Andrés G. Montañez wrote
>>
>> Hi Ron, what's what you want to sync? Contacts? Or everything else?
>> You want to sync it over the internet? Or over wire?
>> You should research the iPhone API/SDK for sync;
>> and not focus with MySQL, wich is just an storage.
>>
>> Cheers.
>>
>> On 23 October 2010 03:09, Karl DeSaulniers  wrote:
>>
>>>
>>> I believe there is a MySQL for the iphone
>>> iMy?
>>>
>>> http://forums.mysql.com/read.php?58,249718,249718
>>>
>>> You'd probably want o use JASON or an equiv. to talk back and forth with
>>> your database and app.
>>> At least thats the consensus I'm finding on posts about it.
>>>
>>> HTH
>>> Karl
>>>
>>> On Oct 22, 2010, at 11:21 PM, listread wrote:
>>>
>>>

 Hey all!

 Does anyone know how to go about syncing a MySQL db with an iPhone over
 the internet?

 An alternative would be syncing with Google Contacts, which then could
 sync with the iPhone.  I think Google Contacts uses Exchange Server to
 sync
 with devices.

 Thanks!

 - Ron



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


>>>
>>> Karl DeSaulniers
>>> Design Drumm
>>> http://designdrumm.com
>>>
>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Andrés G. Montañez
Zend Certified Engineer
Montevideo - Uruguay

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



Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-23 Thread listread

Karl / Andrés

Thanks for your replies.

iMy appears to be only a client and I can already access servers with 
php on the iPhone web browser.


I would like MySQL on my iPhone.  There was a way to make a jailbroke 
iPhone a MySQL server, but I'm not sure it is available any longer.


My immediate desire is to sync the iPhone's native contacts and, 
perhaps, the calendar with our online server over the internet.  
Preferably syncs would be "pushed".


With a Google Gmail account, you can already do just exactly that.  Once 
set up, if you update your Gmail contacts, a minute or two later your 
iPhone contacts will be sync'd.  It's supposed to work with the Google 
calendar, too, but I haven't tried it.  It appears that Google is using 
a MS Exchange Server or similar.  The setup in the iPhone uses the 
Exchange server settings.  See http://www.google.com/mobile/sync/


The solution I'm looking for would be server side -- if not completely, 
in part.   Again, it would be best to sync directly to the iPhone, but 
if the server would sync with the Google calendar and Google sync'd with 
the iPhone, that would be an acceptable 2nd choice.


Thanks again for your reply!

- Ron




On 10/23/2010 5:47 AM, Andrés G. Montañez wrote

Hi Ron, what's what you want to sync? Contacts? Or everything else?
You want to sync it over the internet? Or over wire?
You should research the iPhone API/SDK for sync;
and not focus with MySQL, wich is just an storage.

Cheers.

On 23 October 2010 03:09, Karl DeSaulniers  wrote:
   

I believe there is a MySQL for the iphone
iMy?

http://forums.mysql.com/read.php?58,249718,249718

You'd probably want o use JASON or an equiv. to talk back and forth with
your database and app.
At least thats the consensus I'm finding on posts about it.

HTH
Karl

On Oct 22, 2010, at 11:21 PM, listread wrote:

 

Hey all!

Does anyone know how to go about syncing a MySQL db with an iPhone over
the internet?

An alternative would be syncing with Google Contacts, which then could
sync with the iPhone.  I think Google Contacts uses Exchange Server to sync
with devices.

Thanks!

- Ron



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

   

Karl DeSaulniers
Design Drumm
http://designdrumm.com


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


 



   



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



Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-23 Thread Andrés G . Montañez
Hi Ron, what's what you want to sync? Contacts? Or everything else?
You want to sync it over the internet? Or over wire?
You should research the iPhone API/SDK for sync;
and not focus with MySQL, wich is just an storage.

Cheers.

On 23 October 2010 03:09, Karl DeSaulniers  wrote:
> I believe there is a MySQL for the iphone
> iMy?
>
> http://forums.mysql.com/read.php?58,249718,249718
>
> You'd probably want o use JASON or an equiv. to talk back and forth with
> your database and app.
> At least thats the consensus I'm finding on posts about it.
>
> HTH
> Karl
>
> On Oct 22, 2010, at 11:21 PM, listread wrote:
>
>> Hey all!
>>
>> Does anyone know how to go about syncing a MySQL db with an iPhone over
>> the internet?
>>
>> An alternative would be syncing with Google Contacts, which then could
>> sync with the iPhone.  I think Google Contacts uses Exchange Server to sync
>> with devices.
>>
>> Thanks!
>>
>> - Ron
>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Andrés G. Montañez
Zend Certified Engineer
Montevideo - Uruguay

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



Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-22 Thread Karl DeSaulniers

I believe there is a MySQL for the iphone
iMy?

http://forums.mysql.com/read.php?58,249718,249718

You'd probably want o use JASON or an equiv. to talk back and forth  
with your database and app.

At least thats the consensus I'm finding on posts about it.

HTH
Karl

On Oct 22, 2010, at 11:21 PM, listread wrote:


Hey all!

Does anyone know how to go about syncing a MySQL db with an iPhone  
over the internet?


An alternative would be syncing with Google Contacts, which then  
could sync with the iPhone.  I think Google Contacts uses Exchange  
Server to sync with devices.


Thanks!

- Ron



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



Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



[PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-22 Thread listread

Hey all!

Does anyone know how to go about syncing a MySQL db with an iPhone over 
the internet?


An alternative would be syncing with Google Contacts, which then could 
sync with the iPhone.  I think Google Contacts uses Exchange Server to 
sync with devices.


Thanks!

- Ron



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



Re: [PHP-DB] how to explain such a regular syntax

2010-08-12 Thread Peter Lind
On 13 August 2010 08:47, win.a  wrote:
> Its was picked from drupal source code and i don't know how does it works.
> This is the code :
> preg_match('/^\[?(?:[a-z0-9-:\]_]+\.?)+$/', $host);

This has got nothing to do with php or php-db - your question is on
regular expressions. Try consulting
http://www.regular-expressions.info/ or get a good book on the topic
like Mastering Regular Expresssions by Jeffrey Friedl.

Regards
Peter

-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15


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



[PHP-DB] how to explain such a regular syntax

2010-08-12 Thread win.a
Its was picked from drupal source code and i don't know how does it works.
This is the code :
preg_match('/^\[?(?:[a-z0-9-:\]_]+\.?)+$/', $host);

After followed the regular syntax ,i try to cut it into pieces to make
it simpler to
understand ,
part a1: ^\[?
part a2:([a-z0-9-:\]_]+\.?)+$

Then go on cut part a2:
a2_1:  ?:
a2_2:  ([a-z0-9-:\]_]+\.?)+$
a2_3: a2_2 and   +$

a1 means:start with nothing or one "?"
a2_2 means character must be in a-z,0-9 ,"]","_" and the number must
be only one
a2_3 means there must be one and only matched a2_2 string .

And i dint't got a2_1 mean.
Anyone could explain the it works and the fault of my analysis are appreciated!


All you best

What we are struggling for ?
The life or the life ?

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



Re: [PHP-DB]how to handle exception in php

2010-05-08 Thread Bavithra R
hi friends...

Thanks for your suggestions..but i could not get the exact rank list
properly..
My code is as below..

$sql2="SELECT * FROM rank";
$result=mysql_query($sql2,$con);
$num=mysql_num_rows($result);
for($i=0;$i<$num;$i++)
{
$f1=mysql_result($result,$i,"regno");
$d6=mysql_result($result,$i,"total");
$d7=mysql_result($result,$i+1,"total");
$d8=mysql_result($result,$i,"rank");
if($d6==$d7)
{
$sql8="UPDATE $_POST[test] set rank='$i'+1 where total='$d6'";
mysql_query($sql8,$con);
}
else if($d6!=$d7)
{
$sql1="UPDATE $_POST[test] SET rank='$i'+1 WHERE regno='$f1'";
mysql_query($sql1,$con);
}

But if i use while loop as you people said..No such list is obtained.
Please check and tell if i could do any changes in the above code..

Also if any two students has secured the same total they has to be given the
same rank..Till now it generates the rank but in this order...1 2 3 4 7 7
7..As the last 3  students has the got same total..
any suggestion


regards
--Bavithra


Re: [PHP-DB] how to upgrade php in linux

2010-05-05 Thread Chaitanya Yanamadala
I apologize guys for being rude..
i know that u guys are helping me out, but i was in a typical awkward
position searching for the same things made me a little restless.

coming to the point i have posted the question to the centos list as well as
suggested by dan..
but still now i could not able to find an absolute solution for what i am
searching for..

Chaitanya




On Wed, May 5, 2010 at 7:38 PM, Dan Carl  wrote:

> On 5/5/2010 12:02 AM, Chaitanya Yanamadala wrote:
>
>> hai dan
>> thank you for your suggestion regarding the google thing..
>> thank god u said me that or else i could have never known that google will
>> get me all the results.
>> dude i just asked this question thinking that some one would help me find
>> the solution not for fun.
>> regarding the thing of compiling i require it to be done,
>>
>
> I gave you a link to the Centos list archives so you could search there
> before posting to the Centos list.
> The reason I suggested using Google's site search function is that the list
> archives has no search function of its own.
> Not many people know you can use google to search only a particular site or
> branch of a site. I pointed it out is because after
>  sending folks to the list archives the next question is, how do I search
> the archives.
>
> I see you're finally posting Centos questions to the Centos list not the
> PHP list.
> Good luck getting help with your attitude.
>
>


Re: [PHP-DB] how to upgrade php in linux

2010-05-04 Thread kesavan trichy rengarajan
No idea what's happening there. Have u done this:
yum update
?

On Wed, May 5, 2010 at 3:02 PM, Chaitanya Yanamadala <
dr.virus.in...@gmail.com> wrote:

> hai dan
> thank you for your suggestion regarding the google thing..
> thank god u said me that or else i could have never known that google will
> get me all the results.
> dude i just asked this question thinking that some one would help me find
> the solution not for fun.
> regarding the thing of compiling i require it to be done,
>
> hai kesavan
>  thank you for the help i have done that search and i found the things but
> the thing is that it is an old version of the gcc that is still exisiting
> in
> the yum repository.
> i require one dependancy apr-1.3.3 for the compiling of httpd 2.3.5  which
> i
> have found out, but the thing is that it requires two more dependancies
> uname >=2.6
> and rpmlib<=4.4.6 which are  not available in the yum repo..
>
> i better try to do this on my own..
> thank you guys for your help
>
>
>
> Chaitanya
>
>
>
> On Wed, May 5, 2010 at 1:53 AM, Kesavan Rengarajan  wrote:
>
> > As someone else mentioned in the list, try the remi repository.
> >
> > If you still want to compile from source, then this is what you do to
> > search for packages:
> >
> > yum search packagename
> > So you would be doing:
> > yum search gcc
> >  and then install the missing package before compiling php.
> >
> > You may have to install a few missing packages and it's not really a lot
> of
> > fun :(.
> >
> > Also, I would like to let you know if you are going to be using Zend
> > Framework, you better stick with the 5.2 series as I know that there are
> a
> > few issues with 5.3 and ZF. There are a few other bugs that forced me to
> > downgrade to 5.2.
> > Sent from my iPhone
> >
> >
> > On 05/05/2010, at 4:59 AM, Chaitanya Yanamadala <
> dr.virus.in...@gmail.com>
> > wrote:
> >
> >  hai bavitra
> >> i have read the article from this site
> >> http://www.web-tech-india.com/articles/php/compiling_php_apache/
> >> but actually the thing is it is not working for me..
> >>
> >> it is giving me some error like this
> >> checking for gcc ---no
> >> checking for cc--no
> >> configure: error: no acceptable cc found in $PATH..
> >>
> >> this tells me that the i am missing the cross compiler from my machine
> but
> >> i
> >> dont have an idea from where can i get this..
> >>
> >>
> >> Chaitanya
> >>
> >>
> >>
> >> On Tue, May 4, 2010 at 8:45 PM, Bavithra R 
> wrote:
> >>
> >>
> >>>
> >>>  i have downloaded the tar file from php.net but dont know how to
>  complile
>   the same for the linux.
> 
>  Hi Chaitanya
> 
> 
>  As you have downloaded the tar file you need to extract it.
> 
>    Try this
> >>> *Extraction:  *tar -jxvf php-5.3.2.tar.bz2
> >>> where php-5.3.2.tar.bz2 is the filename you downloaded.
> >>> Check to the file extension whether it is .bz2
> >>> If not use
> >>> tar --help
> >>> which provides the extraction options.
> >>> Then you need to configure it.For that
> >>> *  configuration: *   ./configure --prefix==/usr/local/php
> >>> I hope this works.Try and see
> >>>
> >>>
> >>>
> >>> regards
> >>> --Bavithra
> >>>
> >>>
> >>>
> >>>
>


Re: [PHP-DB] how to upgrade php in linux

2010-05-04 Thread Chris

On 05/05/10 15:02, Chaitanya Yanamadala wrote:

hai dan
thank you for your suggestion regarding the google thing..
thank god u said me that or else i could have never known that google will
get me all the results.
dude i just asked this question thinking that some one would help me find
the solution not for fun.
regarding the thing of compiling i require it to be done,

hai kesavan
  thank you for the help i have done that search and i found the things but
the thing is that it is an old version of the gcc that is still exisiting in
the yum repository.
i require one dependancy apr-1.3.3 for the compiling of httpd 2.3.5  which i
have found out, but the thing is that it requires two more dependancies
uname>=2.6
and rpmlib<=4.4.6 which are  not available in the yum repo..


Do you need to use centos? Maybe it'll be easier for you to use a more 
up to date operating system. Ubuntu 10 just came out and it has php 5.3 
available.


We can't teach you how to compile stuff, that's way outside what we're 
here to help you with. Don't forget everyone here is helping you in 
their own free time, so you may not get "perfect" answers but you will 
get pointers in the right direction (even if it is to google or 
tutorials on other websites).


--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB] how to upgrade php in linux

2010-05-04 Thread Chaitanya Yanamadala
hai dan
thank you for your suggestion regarding the google thing..
thank god u said me that or else i could have never known that google will
get me all the results.
dude i just asked this question thinking that some one would help me find
the solution not for fun.
regarding the thing of compiling i require it to be done,

hai kesavan
 thank you for the help i have done that search and i found the things but
the thing is that it is an old version of the gcc that is still exisiting in
the yum repository.
i require one dependancy apr-1.3.3 for the compiling of httpd 2.3.5  which i
have found out, but the thing is that it requires two more dependancies
uname >=2.6
and rpmlib<=4.4.6 which are  not available in the yum repo..

i better try to do this on my own..
thank you guys for your help



Chaitanya



On Wed, May 5, 2010 at 1:53 AM, Kesavan Rengarajan  wrote:

> As someone else mentioned in the list, try the remi repository.
>
> If you still want to compile from source, then this is what you do to
> search for packages:
>
> yum search packagename
> So you would be doing:
> yum search gcc
>  and then install the missing package before compiling php.
>
> You may have to install a few missing packages and it's not really a lot of
> fun :(.
>
> Also, I would like to let you know if you are going to be using Zend
> Framework, you better stick with the 5.2 series as I know that there are a
> few issues with 5.3 and ZF. There are a few other bugs that forced me to
> downgrade to 5.2.
> Sent from my iPhone
>
>
> On 05/05/2010, at 4:59 AM, Chaitanya Yanamadala 
> wrote:
>
>  hai bavitra
>> i have read the article from this site
>> http://www.web-tech-india.com/articles/php/compiling_php_apache/
>> but actually the thing is it is not working for me..
>>
>> it is giving me some error like this
>> checking for gcc ---no
>> checking for cc--no
>> configure: error: no acceptable cc found in $PATH..
>>
>> this tells me that the i am missing the cross compiler from my machine but
>> i
>> dont have an idea from where can i get this..
>>
>>
>> Chaitanya
>>
>>
>>
>> On Tue, May 4, 2010 at 8:45 PM, Bavithra R  wrote:
>>
>>
>>>
>>>  i have downloaded the tar file from php.net but dont know how to
 complile
  the same for the linux.

 Hi Chaitanya


 As you have downloaded the tar file you need to extract it.

   Try this
>>> *Extraction:  *tar -jxvf php-5.3.2.tar.bz2
>>> where php-5.3.2.tar.bz2 is the filename you downloaded.
>>> Check to the file extension whether it is .bz2
>>> If not use
>>> tar --help
>>> which provides the extraction options.
>>> Then you need to configure it.For that
>>> *  configuration: *   ./configure --prefix==/usr/local/php
>>> I hope this works.Try and see
>>>
>>>
>>>
>>> regards
>>> --Bavithra
>>>
>>>
>>>
>>>


Re: [PHP-DB] how to upgrade php in linux

2010-05-04 Thread Kesavan Rengarajan

As someone else mentioned in the list, try the remi repository.

If you still want to compile from source, then this is what you do to  
search for packages:


yum search packagename
So you would be doing:
yum search gcc
 and then install the missing package before compiling php.

You may have to install a few missing packages and it's not really a  
lot of fun :(.


Also, I would like to let you know if you are going to be using Zend  
Framework, you better stick with the 5.2 series as I know that there  
are a few issues with 5.3 and ZF. There are a few other bugs that  
forced me to downgrade to 5.2.

Sent from my iPhone

On 05/05/2010, at 4:59 AM, Chaitanya Yanamadala > wrote:



hai bavitra
i have read the article from this site
http://www.web-tech-india.com/articles/php/compiling_php_apache/
but actually the thing is it is not working for me..

it is giving me some error like this
checking for gcc ---no
checking for cc--no
configure: error: no acceptable cc found in $PATH..

this tells me that the i am missing the cross compiler from my  
machine but i

dont have an idea from where can i get this..


Chaitanya



On Tue, May 4, 2010 at 8:45 PM, Bavithra R   
wrote:






i have downloaded the tar file from php.net but dont know how to
complile
  the same for the linux.

Hi Chaitanya


As you have downloaded the tar file you need to extract it.


  Try this
*Extraction:  *tar -jxvf php-5.3.2.tar.bz2
where php-5.3.2.tar.bz2 is the filename you downloaded.
Check to the file extension whether it is .bz2
If not use
 tar --help
which provides the extraction options.
Then you need to configure it.For that
*  configuration: *   ./configure --prefix==/usr/local/php
I hope this works.Try and see



regards
--Bavithra





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



Re: [PHP-DB] how to upgrade php in linux

2010-05-04 Thread Chaitanya Yanamadala
hai bavitra
 i have read the article from this site
 http://www.web-tech-india.com/articles/php/compiling_php_apache/
but actually the thing is it is not working for me..

it is giving me some error like this
checking for gcc ---no
checking for cc--no
configure: error: no acceptable cc found in $PATH..

this tells me that the i am missing the cross compiler from my machine but i
dont have an idea from where can i get this..


Chaitanya



On Tue, May 4, 2010 at 8:45 PM, Bavithra R  wrote:

>
>
> >  i have downloaded the tar file from php.net but dont know how to
>> complile
>>the same for the linux.
>>
>> Hi Chaitanya
>>
>>
>> As you have downloaded the tar file you need to extract it.
>>
>Try this
> *Extraction:  *tar -jxvf php-5.3.2.tar.bz2
> where php-5.3.2.tar.bz2 is the filename you downloaded.
> Check to the file extension whether it is .bz2
> If not use
>   tar --help
> which provides the extraction options.
> Then you need to configure it.For that
> *  configuration: *   ./configure --prefix==/usr/local/php
> I hope this works.Try and see
>
>
>
> regards
> --Bavithra
>
>
>


Re: [PHP-DB]how to handle exception in php

2010-05-04 Thread Richard Quadling
On 2 May 2010 06:26, Bavithra R  wrote:
> hi friends
>
> I am doing a simple student mark details project.
> for calculating rank I need to compare the total marks one by one.
> To do so i use *for loop.* so atlast while reaching the end of the table it
> shows the following warning.
> *
> Warning*: mysql_result()
> [function.mysql-result]:
> Unable to jump to row 18 on MySQL result index on line *50*
>
> It is because it has no next value to compare.How to use try..catch
> exception handling in this.?Or any other suggestion.
> Can anybody help me
>
> --Bavithra
>

Commonly the while loop looks like ...

while ($row = mysql_fetch_assoc($result)) {

If you intend to use this for other loops, watch out where the result
of the function is False to indicate the end of the iterations.

while (False !== ($row = mysql_fetch_assoc($result))) {

Whilst this offers nothing extra here, for functions where 0 or "" are
valid responses and False is the "get me out of here" response,
testing for type and value (!==) is important.

-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP-DB] how to upgrade php in linux

2010-05-04 Thread Bavithra R
>  i have downloaded the tar file from php.net but dont know how to complile
>the same for the linux.
>
> Hi Chaitanya
>
>
> As you have downloaded the tar file you need to extract it.
>
   Try this
*Extraction:  *tar -jxvf php-5.3.2.tar.bz2
where php-5.3.2.tar.bz2 is the filename you downloaded.
Check to the file extension whether it is .bz2
If not use
  tar --help
which provides the extraction options.
Then you need to configure it.For that
*  configuration: *   ./configure --prefix==/usr/local/php
I hope this works.Try and see



regards
--Bavithra


Re: [PHP-DB] how to upgrade php in linux

2010-05-03 Thread jose javier parra sanchez
php 5.3.2 is availabe in remi repository, so go to
http://blog.famillecollet.com/ and read or go directly to
http://blog.famillecollet.com/pages/Config-en

2010/5/3 Chaitanya Yanamadala :
> hai kesavan
>  the latest rpm is what i have installed already.
> but i require the php 5.3.2 to be installed so where can i get the rpm for
> that
> i hve used the yum search php which is giving me the 5.1 only..
>
> Chaitanya
>
>
>
>
> On Mon, May 3, 2010 at 6:54 PM, Kesavan Rengarajan  wrote:
>
>> Add DAG and RPMForge repos (google for how to) and try to do a yum
>> install.Compiling from source might not be the best option if you are new to
>> Linux.
>>
>> Sent from my iPhone
>>
>>
>> On 03/05/2010, at 10:57 PM, Chaitanya Yanamadala 
>> wrote:
>>
>>  hai david
>>>
>>> the rpm available is for this is the one which i am having that is the
>>> latest one.
>>> but i require to install the 5.3.2 for some more extenstions to be
>>> working.
>>> i have downloaded the tar file from php.net but dont know how to complile
>>> the same for the linux. i am pretty new to the linux..
>>> so cannot able to figure out how to do the same..
>>>
>>>
>>> Chaitanya
>>>
>>>
>>>
>>>
>>> On Mon, May 3, 2010 at 6:15 PM, David McGlone 
>>> wrote:
>>>
>>>  On Monday 03 May 2010 07:02:35 Chaitanya Yanamadala wrote:

> Hai
> i have installed php in the cent os 5.4. the one which is installed is
> 5.1.6 now what i want to do is upgrade it to latest one 5.3.2, as i am
>
 new

> to linux environment it is quite hard for me to configure that, can any
>
 one

> guide me with this also one more thing is that i need to install zend
> framework in the same environment,
> any help would be greatly appreciate..
>

 I have no experience with CentOS but I'm pretty sure it would have a
 package
 manager similiar to apt-get, or yum.

 If CentOS uses RPM then you could go download php 5.3.2 off the web and
 then
 open a terminal and type:
 root (to login as root)
 password (enter root password)
 change the directory to where you saved the file:
 cd /path/to/where/the/file/is
 rpm -Uvh ( enter name of the package that you downloaded here and omit
 the
 parenthesis )


 --
 Blessings,
 David M.

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



>

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



Re: [PHP-DB] how to upgrade php in linux

2010-05-03 Thread Chaitanya Yanamadala
hai kesavan
 the latest rpm is what i have installed already.
but i require the php 5.3.2 to be installed so where can i get the rpm for
that
i hve used the yum search php which is giving me the 5.1 only..

Chaitanya




On Mon, May 3, 2010 at 6:54 PM, Kesavan Rengarajan  wrote:

> Add DAG and RPMForge repos (google for how to) and try to do a yum
> install.Compiling from source might not be the best option if you are new to
> Linux.
>
> Sent from my iPhone
>
>
> On 03/05/2010, at 10:57 PM, Chaitanya Yanamadala 
> wrote:
>
>  hai david
>>
>> the rpm available is for this is the one which i am having that is the
>> latest one.
>> but i require to install the 5.3.2 for some more extenstions to be
>> working.
>> i have downloaded the tar file from php.net but dont know how to complile
>> the same for the linux. i am pretty new to the linux..
>> so cannot able to figure out how to do the same..
>>
>>
>> Chaitanya
>>
>>
>>
>>
>> On Mon, May 3, 2010 at 6:15 PM, David McGlone 
>> wrote:
>>
>>  On Monday 03 May 2010 07:02:35 Chaitanya Yanamadala wrote:
>>>
 Hai
 i have installed php in the cent os 5.4. the one which is installed is
 5.1.6 now what i want to do is upgrade it to latest one 5.3.2, as i am

>>> new
>>>
 to linux environment it is quite hard for me to configure that, can any

>>> one
>>>
 guide me with this also one more thing is that i need to install zend
 framework in the same environment,
 any help would be greatly appreciate..

>>>
>>> I have no experience with CentOS but I'm pretty sure it would have a
>>> package
>>> manager similiar to apt-get, or yum.
>>>
>>> If CentOS uses RPM then you could go download php 5.3.2 off the web and
>>> then
>>> open a terminal and type:
>>> root (to login as root)
>>> password (enter root password)
>>> change the directory to where you saved the file:
>>> cd /path/to/where/the/file/is
>>> rpm -Uvh ( enter name of the package that you downloaded here and omit
>>> the
>>> parenthesis )
>>>
>>>
>>> --
>>> Blessings,
>>> David M.
>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>


Re: [PHP-DB] how to upgrade php in linux

2010-05-03 Thread Kesavan Rengarajan
Add DAG and RPMForge repos (google for how to) and try to do a yum  
install.Compiling from source might not be the best option if you are  
new to Linux.


Sent from my iPhone

On 03/05/2010, at 10:57 PM, Chaitanya Yanamadala > wrote:



hai david

the rpm available is for this is the one which i am having that is the
latest one.
but i require to install the 5.3.2 for some more extenstions to be  
working.
i have downloaded the tar file from php.net but dont know how to  
complile

the same for the linux. i am pretty new to the linux..
so cannot able to figure out how to do the same..


Chaitanya




On Mon, May 3, 2010 at 6:15 PM, David McGlone   
wrote:



On Monday 03 May 2010 07:02:35 Chaitanya Yanamadala wrote:

Hai
i have installed php in the cent os 5.4. the one which is  
installed is
5.1.6 now what i want to do is upgrade it to latest one 5.3.2, as  
i am

new
to linux environment it is quite hard for me to configure that,  
can any

one
guide me with this also one more thing is that i need to install  
zend

framework in the same environment,
any help would be greatly appreciate..


I have no experience with CentOS but I'm pretty sure it would have a
package
manager similiar to apt-get, or yum.

If CentOS uses RPM then you could go download php 5.3.2 off the web  
and

then
open a terminal and type:
root (to login as root)
password (enter root password)
change the directory to where you saved the file:
cd /path/to/where/the/file/is
rpm -Uvh ( enter name of the package that you downloaded here and  
omit the

parenthesis )


--
Blessings,
David M.

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




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



Re: [PHP-DB] how to upgrade php in linux

2010-05-03 Thread Chaitanya Yanamadala
hai david

 the rpm available is for this is the one which i am having that is the
latest one.
but i require to install the 5.3.2 for some more extenstions to be working.
i have downloaded the tar file from php.net but dont know how to complile
the same for the linux. i am pretty new to the linux..
so cannot able to figure out how to do the same..


Chaitanya




On Mon, May 3, 2010 at 6:15 PM, David McGlone  wrote:

> On Monday 03 May 2010 07:02:35 Chaitanya Yanamadala wrote:
> > Hai
> >  i have installed php in the cent os 5.4. the one which is installed is
> > 5.1.6 now what i want to do is upgrade it to latest one 5.3.2, as i am
> new
> > to linux environment it is quite hard for me to configure that, can any
> one
> > guide me with this also one more thing is that i need to install zend
> > framework in the same environment,
> > any help would be greatly appreciate..
>
> I have no experience with CentOS but I'm pretty sure it would have a
> package
> manager similiar to apt-get, or yum.
>
> If CentOS uses RPM then you could go download php 5.3.2 off the web and
> then
> open a terminal and type:
> root (to login as root)
> password (enter root password)
> change the directory to where you saved the file:
> cd /path/to/where/the/file/is
> rpm -Uvh ( enter name of the package that you downloaded here and omit the
> parenthesis )
>
>
> --
> Blessings,
> David M.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP-DB] how to upgrade php in linux

2010-05-03 Thread David McGlone
On Monday 03 May 2010 07:02:35 Chaitanya Yanamadala wrote:
> Hai
>  i have installed php in the cent os 5.4. the one which is installed is
> 5.1.6 now what i want to do is upgrade it to latest one 5.3.2, as i am new
> to linux environment it is quite hard for me to configure that, can any one
> guide me with this also one more thing is that i need to install zend
> framework in the same environment,
> any help would be greatly appreciate..

I have no experience with CentOS but I'm pretty sure it would have a package 
manager similiar to apt-get, or yum.

If CentOS uses RPM then you could go download php 5.3.2 off the web and then 
open a terminal and type:
root (to login as root)
password (enter root password)
change the directory to where you saved the file:
cd /path/to/where/the/file/is
rpm -Uvh ( enter name of the package that you downloaded here and omit the 
parenthesis )


-- 
Blessings,
David M.

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



[PHP-DB] how to upgrade php in linux

2010-05-03 Thread Chaitanya Yanamadala
Hai
 i have installed php in the cent os 5.4. the one which is installed is
5.1.6 now what i want to do is upgrade it to latest one 5.3.2, as i am new
to linux environment it is quite hard for me to configure that, can any one
guide me with this also one more thing is that i need to install zend
framework in the same environment,
any help would be greatly appreciate..

regards
Chaitanya


Re: [PHP-DB]how to handle exception in php

2010-05-02 Thread Chris

On 02/05/10 15:26, Bavithra R wrote:

hi friends

I am doing a simple student mark details project.
for calculating rank I need to compare the total marks one by one.
To do so i use *for loop.* so atlast while reaching the end of the table it
shows the following warning.
*
Warning*: mysql_result()
[function.mysql-result]:
Unable to jump to row 18 on MySQL result index on line *50*

It is because it has no next value to compare.How to use try..catch
exception handling in this.?Or any other suggestion.
Can anybody help me


This isn't an exception, so a try catch won't work. (Exceptions are 
fatal and would say something like "uncaught exception ...").


This is a warning about trying to read something that doesn't exist from 
mysql.


I'd do something like

$query = "select blah";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
  echo "do stuff here";
}

--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB]how to handle exception in php

2010-05-02 Thread Luiz Alberto
Dear Bavithra,

I would suggest you the following solution 

$sql = "SELECT x FROM y";
$rs  = mysql_query ($sql)
$num = mysql_numrows($rs);
while ($i < $num){
z = mysql_result($rs, $i, 'x');
$i++;
}

I hope that above solution  help you.

Luiz Alberto


On Sun, 2010-05-02 at 10:56 +0530, Bavithra R wrote:
> hi friends
> 
> I am doing a simple student mark details project.
> for calculating rank I need to compare the total marks one by one.
> To do so i use *for loop.* so atlast while reaching the end of the table it
> shows the following warning.
> *
> Warning*: mysql_result()
> [function.mysql-result]:
> Unable to jump to row 18 on MySQL result index on line *50*
> 
> It is because it has no next value to compare.How to use try..catch
> exception handling in this.?Or any other suggestion.
> Can anybody help me
> 
> --Bavithra


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



[PHP-DB]how to handle exception in php

2010-05-01 Thread Bavithra R
hi friends

I am doing a simple student mark details project.
for calculating rank I need to compare the total marks one by one.
To do so i use *for loop.* so atlast while reaching the end of the table it
shows the following warning.
*
Warning*: mysql_result()
[function.mysql-result]:
Unable to jump to row 18 on MySQL result index on line *50*

It is because it has no next value to compare.How to use try..catch
exception handling in this.?Or any other suggestion.
Can anybody help me

--Bavithra


Re: [PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread Karl DeSaulniers

Just a thought,
You may be able to instead of having them download, just display it  
as a html page
and the fields will be there, then attach a PHP mail script to it  
somehow with a macro or something to that effect.
Have it call on this php script to send the message and/or store in  
the database.
The php script will have to be attached to the basic pdf before its  
uploaded, but I think that is possible.

Might be worth some investigating. Doesn't seem to difficult.

Karl


On May 2, 2010, at 12:18 AM, Karl DeSaulniers wrote:


Hi Ron,
I have done this once before and what I had to do was let the user  
download the pdf that had the fields in it, they fill in the fields  
and email the pdf back, right from acrobat.
In the pdf, you set the fields to lock after they finish and  
submit. You can also have them sign the document virtually then  
lock the whole document.
Then you set it up to email the pdf back to you. They will need a  
email program for this on their computer of course. Like Eudora or  
Mail or Outlook.
You can put a notice link in the PDF to an upload form on your site  
if they do not have a mail program.


You will need Acrobat Professional to do this though. There may be  
another one I don't know of.

HTH,

Karl


On May 1, 2010, at 10:36 PM, listread wrote:

Yes, I've looked hard at fdpf and see how it is used to generate a  
new pdf, but I need to simply fill in the form fields in an  
existing pdf.  If it can do that, I'm not finding the feature


Thanks,

- Ron

On 5/1/2010 7:43 PM, Gary wrote:

"listread"  wrote in message
news:4bdc9ced.3060...@cze.com...

Yes, we can first ask the user to fill in a form, but then comes  
the part

I don't understand - how to covert it to pdf.

It would be best if we could just fill in the fields on an  
existing form,
but it would also work to print the printer friendly form to the  
server's
printer queue, which could really be a postscript file we could  
then
convert to pdf.  In that case, I need to learn how to get PHP to  
print to

the server's printer...

- Ron

On 5/1/2010 7:53 AM, nagendra prasad wrote:

I am not sure if this works for your project but you can first  
ask user

to
fill the form in PHP and then convert it into PDF. What say?





__ Information from ESET Smart Security, version of virus
signature database 5078 (20100501) __

The message was checked by ESET Smart Security.

http://www.eset.com





Ron

Take a peek at this

http://fpdf.org/

Writing to a pdf from php is very cumbersome, this seems to take  
some of the

sting out.

Gary



__ Information from ESET Smart Security, version of virus  
signature database 5078 (20100501) __


The message was checked by ESET Smart Security.

http://www.eset.com









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



Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread Karl DeSaulniers

Hi Ron,
I have done this once before and what I had to do was let the user  
download the pdf that had the fields in it, they fill in the fields  
and email the pdf back, right from acrobat.
In the pdf, you set the fields to lock after they finish and submit.  
You can also have them sign the document virtually then lock the  
whole document.
Then you set it up to email the pdf back to you. They will need a  
email program for this on their computer of course. Like Eudora or  
Mail or Outlook.
You can put a notice link in the PDF to an upload form on your site  
if they do not have a mail program.


You will need Acrobat Professional to do this though. There may be  
another one I don't know of.

HTH,

Karl


On May 1, 2010, at 10:36 PM, listread wrote:

Yes, I've looked hard at fdpf and see how it is used to generate a  
new pdf, but I need to simply fill in the form fields in an  
existing pdf.  If it can do that, I'm not finding the feature


Thanks,

- Ron

On 5/1/2010 7:43 PM, Gary wrote:

"listread"  wrote in message
news:4bdc9ced.3060...@cze.com...

Yes, we can first ask the user to fill in a form, but then comes  
the part

I don't understand - how to covert it to pdf.

It would be best if we could just fill in the fields on an  
existing form,
but it would also work to print the printer friendly form to the  
server's

printer queue, which could really be a postscript file we could then
convert to pdf.  In that case, I need to learn how to get PHP to  
print to

the server's printer...

- Ron

On 5/1/2010 7:53 AM, nagendra prasad wrote:

I am not sure if this works for your project but you can first  
ask user

to
fill the form in PHP and then convert it into PDF. What say?





__ Information from ESET Smart Security, version of virus
signature database 5078 (20100501) __

The message was checked by ESET Smart Security.

http://www.eset.com





Ron

Take a peek at this

http://fpdf.org/

Writing to a pdf from php is very cumbersome, this seems to take  
some of the

sting out.

Gary



__ Information from ESET Smart Security, version of virus  
signature database 5078 (20100501) __


The message was checked by ESET Smart Security.

http://www.eset.com









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



Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread listread
Yes, I've looked hard at fdpf and see how it is used to generate a new 
pdf, but I need to simply fill in the form fields in an existing pdf.  
If it can do that, I'm not finding the feature


Thanks,

- Ron

On 5/1/2010 7:43 PM, Gary wrote:

"listread"  wrote in message
news:4bdc9ced.3060...@cze.com...
   

Yes, we can first ask the user to fill in a form, but then comes the part
I don't understand - how to covert it to pdf.

It would be best if we could just fill in the fields on an existing form,
but it would also work to print the printer friendly form to the server's
printer queue, which could really be a postscript file we could then
convert to pdf.  In that case, I need to learn how to get PHP to print to
the server's printer...

- Ron

On 5/1/2010 7:53 AM, nagendra prasad wrote:
 

I am not sure if this works for your project but you can first ask user
to
fill the form in PHP and then convert it into PDF. What say?


   


__ Information from ESET Smart Security, version of virus
signature database 5078 (20100501) __

The message was checked by ESET Smart Security.

http://www.eset.com



 

Ron

Take a peek at this

http://fpdf.org/

Writing to a pdf from php is very cumbersome, this seems to take some of the
sting out.

Gary



__ Information from ESET Smart Security, version of virus signature 
database 5078 (20100501) __

The message was checked by ESET Smart Security.

http://www.eset.com





   



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



Re: [PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread Gary



"listread"  wrote in message 
news:4bdc9ced.3060...@cze.com...
> Yes, we can first ask the user to fill in a form, but then comes the part 
> I don't understand - how to covert it to pdf.
>
> It would be best if we could just fill in the fields on an existing form, 
> but it would also work to print the printer friendly form to the server's 
> printer queue, which could really be a postscript file we could then 
> convert to pdf.  In that case, I need to learn how to get PHP to print to 
> the server's printer...
>
> - Ron
>
> On 5/1/2010 7:53 AM, nagendra prasad wrote:
>> I am not sure if this works for your project but you can first ask user 
>> to
>> fill the form in PHP and then convert it into PDF. What say?
>>
>>
>
>
> __ Information from ESET Smart Security, version of virus 
> signature database 5078 (20100501) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
Ron

Take a peek at this

http://fpdf.org/

Writing to a pdf from php is very cumbersome, this seems to take some of the 
sting out.

Gary 



__ Information from ESET Smart Security, version of virus signature 
database 5078 (20100501) __

The message was checked by ESET Smart Security.

http://www.eset.com





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



Re: [PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread Kesavan Rengarajan
Search for pdflib or fpdf. They help you with generating PDF files  
from a php script.


Sent from my iPhone

On 02/05/2010, at 7:28 AM, listread  wrote:

Yes, we can first ask the user to fill in a form, but then comes the  
part I don't understand - how to covert it to pdf.


It would be best if we could just fill in the fields on an existing  
form, but it would also work to print the printer friendly form to  
the server's printer queue, which could really be a postscript file  
we could then convert to pdf.  In that case, I need to learn how to  
get PHP to print to the server's printer...


- Ron

On 5/1/2010 7:53 AM, nagendra prasad wrote:
I am not sure if this works for your project but you can first ask  
user to

fill the form in PHP and then convert it into PDF. What say?





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



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



Re: [PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread listread
Yes, we can first ask the user to fill in a form, but then comes the 
part I don't understand - how to covert it to pdf.


It would be best if we could just fill in the fields on an existing 
form, but it would also work to print the printer friendly form to the 
server's printer queue, which could really be a postscript file we could 
then convert to pdf.  In that case, I need to learn how to get PHP to 
print to the server's printer...


- Ron

On 5/1/2010 7:53 AM, nagendra prasad wrote:

I am not sure if this works for your project but you can first ask user to
fill the form in PHP and then convert it into PDF. What say?

   



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



Re: [PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread nagendra prasad
I am not sure if this works for your project but you can first ask user to
fill the form in PHP and then convert it into PDF. What say?


[PHP-DB] How to use PHP to fill in existing pdf document

2010-05-01 Thread listread

Greetings PHP gurus!

Does anyone know of a way to use PHP to fill in the form fields in an 
existing pdf document residing on the server?


We want the end result to be the creation of a unique pdf document for 
each visitor which can either be emailed or stored in a directory on the 
server.


We prefer to do this without any server side dependencies, other than 
files residing on the website.


Thanks in advance for your help.

- Ron

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



Re: [PHP-DB] How to: Include identifier with a query

2009-11-02 Thread Chris

listread wrote:

Greetings!

We are searching for names that might or might not exist in a 4 million 
row db and have to do a lot of fuzzy searches that often don't return 
results.


I would like the use to have the option of killing a query process.  
Since we are apt to have several queries running KILL QUERY doesn't seem 
to work.  I would like to use KILL (process id) instead.  We can use 
SHOW FULL PROCESSLIST to get a complete list of the processes, but we 
need for the code to identify which one to kill.


KILL  works on the process id.

mysql> show processlist;
++--+---+--+-+--+---+--+
| Id | User | Host  | db   | Command | Time | State | Info |
++--+---+--+-+--+---+--+
| 40 | root | localhost | NULL | Query   |0 | NULL  | show 
processlist |

++--+---+--+-+--+---+--+
1 row in set (0.00 sec)


The first column *is* the process id.

Here's the question:  How can I "flag" a particular query so it can be 
identified from the array SHOW FULL PROCESSLIST generates?


You can put comments in your sql:

mysql> /** generated by x */ select now();
+-+
| now()   |
+-+
| 2009-11-03 08:45:49 |
+-+
1 row in set (0.00 sec)

--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB] How to: Include identifier with a query

2009-11-02 Thread TG
I looked into this years ago for something I was doing, but don't remember 
looking for a solution in MySQL.

Just wanted to share that.. um.. I think it was with MS SQL Server.. there 
was a way to put a tag in your DSN connection string that would show up 
on the process list.  I don't know if that helps, but just to add to the 
list of "how *some* people do it".

Good luck!

-TG

- Original Message -
From: listread 
To: php-db@lists.php.net
Date: Mon, 02 Nov 2009 07:16:23 -0600
Subject: [PHP-DB] How to: Include identifier with a query

> Greetings!
> 
> We are searching for names that might or might not exist in a 4 million 
> row db and have to do a lot of fuzzy searches that often don't return 
> results.
> 
> I would like the use to have the option of killing a query process.  
> Since we are apt to have several queries running KILL QUERY doesn't seem 
> to work.  I would like to use KILL (process id) instead.  We can use 
> SHOW FULL PROCESSLIST to get a complete list of the processes, but we 
> need for the code to identify which one to kill.
> 
> Here's the question:  How can I "flag" a particular query so it can be 
> identified from the array SHOW FULL PROCESSLIST generates?
> 
> Thanks!
> 
> - Ron
> 
> 

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



[PHP-DB] How to: Include identifier with a query

2009-11-02 Thread listread

Greetings!

We are searching for names that might or might not exist in a 4 million 
row db and have to do a lot of fuzzy searches that often don't return 
results.


I would like the use to have the option of killing a query process.  
Since we are apt to have several queries running KILL QUERY doesn't seem 
to work.  I would like to use KILL (process id) instead.  We can use 
SHOW FULL PROCESSLIST to get a complete list of the processes, but we 
need for the code to identify which one to kill.


Here's the question:  How can I "flag" a particular query so it can be 
identified from the array SHOW FULL PROCESSLIST generates?


Thanks!

- Ron


Re: [PHP-DB] How to fix config mysql?

2009-07-23 Thread Bastien Koert
Sorry for top posting, a little flaw in the web version of gmail.

Restart the web server to get the ini change to take effect

bastien

On Thursday, July 23, 2009, Ankur Singh  wrote:
> Please add mysql dll to you php extension directory
>
> 2009/7/23 yi wang :
>> Hi, all!
>>
>> I have intalled apache and php on win32, It works fine. I can get phpinfo
>> page correctly.
>>
>> And I intall mysql then. It works fine itself too. I can start the service,
>> and get into mysql throuth the cmd line.
>>
>> But, when I go php with sql by wirting mysql_connect, the broswer says "Call
>> to undefined function mysql_connect()".
>>
>> I have uncommented php_mysql.dll and set the right ext_dir in the php.ini,
>> and made certain that the actural dll does in the ext_dir,
>>
>> and tried all the way by coping dll into windir and set the envirnment var
>> path, but It Simplyly does not work!
>>
>>
>> Cound anyone give me some clues or even solutions? Thank you very much!
>>
>> Best,
>>
>>
>> wangyi
>>
>>
>> --
>> 和你在一起
>>
>
>
>
> --
> The Gate of Change is Locked on the INSIDE.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP-DB] How to fix config mysql?

2009-07-22 Thread Ankur Singh
Please add mysql dll to you php extension directory

2009/7/23 yi wang :
> Hi, all!
>
> I have intalled apache and php on win32, It works fine. I can get phpinfo
> page correctly.
>
> And I intall mysql then. It works fine itself too. I can start the service,
> and get into mysql throuth the cmd line.
>
> But, when I go php with sql by wirting mysql_connect, the broswer says "Call
> to undefined function mysql_connect()".
>
> I have uncommented php_mysql.dll and set the right ext_dir in the php.ini,
> and made certain that the actural dll does in the ext_dir,
>
> and tried all the way by coping dll into windir and set the envirnment var
> path, but It Simplyly does not work!
>
>
> Cound anyone give me some clues or even solutions? Thank you very much!
>
> Best,
>
>
> wangyi
>
>
> --
> 和你在一起
>



-- 
The Gate of Change is Locked on the INSIDE.

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



[PHP-DB] How to fix config mysql?

2009-07-22 Thread yi wang
Hi, all!

I have intalled apache and php on win32, It works fine. I can get phpinfo
page correctly.

And I intall mysql then. It works fine itself too. I can start the service,
and get into mysql throuth the cmd line.

But, when I go php with sql by wirting mysql_connect, the broswer says "Call
to undefined function mysql_connect()".

I have uncommented php_mysql.dll and set the right ext_dir in the php.ini,
and made certain that the actural dll does in the ext_dir,

and tried all the way by coping dll into windir and set the envirnment var
path, but It Simplyly does not work!


Cound anyone give me some clues or even solutions? Thank you very much!

Best,


wangyi


-- 
和你在一起


Re: [PHP-DB] How to access MySQL through PHP in windows 2K.

2009-04-28 Thread YVES SUCAET
Should be simple enough... Do you have the mysqli driver enabled in your
php.ini file?

;extension=php_mysqli.dll

should become

extension=php_mysqli.dll

hth,

Yves

-- Original Message --
Received: Tue, 28 Apr 2009 06:55:37 PM CDT
From: "Katiyar \(GMail\)" 
To: Cc: 
Subject: [PHP-DB] How to access MySQL through PHP in windows 2K. 

Praveen's MailHi List,


I am new to PHP and as well as with MySQL, 

  a.. I have installed PHP 5.28, on win 2K  (with IIS) and it is installed
properly I suppose, as when I call phpinfo (), through a script, it shows the
PHP Information. 
  b.. then I installed MySQL 5.1.30, and through MySQL command prompt I am 
able to do things (creating tables, making queries etc). 
  c.. Now I want to use MySQL with PHP, but seems that MySQLI is not installed
properly. as when I write a following script in a php page I get the error,
that 'MySQLi' is not installed properly,.
 does not  appears to be installed. ' ;
  }
  ?>

I understand that it is a configuration error somewhere, as I am new here in
this world I am unable to figure out what ?

I am attaching the php.ini for the reference.

Praveen K. 


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-= 
Praveen Katiyar 

Site : http://praveenkatiyar.co.cc 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-= 



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




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



[PHP-DB] How to access MySQL through PHP in windows 2K.

2009-04-28 Thread Katiyar (GMail)
Praveen's MailHi List,


I am new to PHP and as well as with MySQL, 

  a.. I have installed PHP 5.28, on win 2K  (with IIS) and it is installed 
properly I suppose, as when I call phpinfo (), through a script, it shows the 
PHP Information. 
  b.. then I installed MySQL 5.1.30, and through MySQL command prompt I am  
able to do things (creating tables, making queries etc). 
  c.. Now I want to use MySQL with PHP, but seems that MySQLI is not installed 
properly. as when I write a following script in a php page I get the error, 
that 'MySQLi' is not installed properly,.
 does not  appears to be installed. ' ;
  }
  ?>

I understand that it is a configuration error somewhere, as I am new here in 
this world I am unable to figure out what ?

I am attaching the php.ini for the reference.

Praveen K. 


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-= 
Praveen Katiyar 

Site : http://praveenkatiyar.co.cc 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-= 

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

Re: [PHP-DB] How to know the name of a function ?

2008-11-09 Thread Stut

On 9 Nov 2008, at 21:41, Jean-Philippe Battu wrote:

In a function, what is the best way to know the name
of this function ?
I read the documentation and found only func_num_args(),
func_get_arg() and func_get_args which are relative to the
arguments given to the function.
What is the equivalent to $0 (bash) in php ?


The constant __FUNCTION__ will give you this.

-Stut

--
http://stut.net/

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



[PHP-DB] How to know the name of a function ?

2008-11-09 Thread Jean-Philippe Battu

Hello

In a function, what is the best way to know the name
of this function ?
I read the documentation and found only func_num_args(),
func_get_arg() and func_get_args which are relative to the
arguments given to the function.
What is the equivalent to $0 (bash) in php ?

Thanks for your help

Cheers

--
Jean-Philippe Battu




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



Re: [PHP-DB] How to retrieve the position of a row inside a table with garbage data in all cloumns?

2008-09-23 Thread Chris

Trullo wrote:

On Tue, Sep 23, 2008 at 6:58 AM, Chris <[EMAIL PROTECTED]> wrote:

To the OP: why does it matter where the row appears in the list?



In the case i'm facing it doesn't matter, but it could be useful to
display a scroll bar related to the size of the table and the row
viewed at the moment, or any simple [begin---youAreHere---end]
representation of the table.


Combine the prev & next queries to work out where you are.

$pages_before = select count(primary_key) from table where primary_key < 
$current_id;


$pages_after = select count(primary_key) from table where primary_key > 
$current_id;


Of course it will be an approximation only because as you are editing 
record #X someone else could be deleting records a,b,c...


--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB] How to retrieve the position of a row inside a table with garbage data in all cloumns?

2008-09-22 Thread Trullo
On Tue, Sep 23, 2008 at 6:58 AM, Chris <[EMAIL PROTECTED]> wrote:
> To the OP: why does it matter where the row appears in the list?
>

In the case i'm facing it doesn't matter, but it could be useful to
display a scroll bar related to the size of the table and the row
viewed at the moment, or any simple [begin---youAreHere---end]
representation of the table.

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



Re: [PHP-DB] How to retrieve the position of a row inside a table with garbage data in all cloumns?

2008-09-22 Thread Chris

Jack van Zanen wrote:

As a caution,
 
 
I would never, ever use a query that relies on the data to be returned 
from the table in a certain order. That is just wrong and goes against 
the principals of a rdbms.


I don't know that it goes against the principle, it's more that a 
database will never guarantee the order of results unless you tell it 
the order to use.


ie unless you specify an order by, the db will return the rows as soon 
as it finds them (which may appear random but it's not really, it's to 
do with where the row will be in the data/index file).


To the OP: why does it matter where the row appears in the list?

--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB] How to retrieve the position of a row inside a table with garbage data in all cloumns?

2008-09-22 Thread Jack van Zanen
As a caution,


I would never, ever use a query that relies on the data to be returned from
the table in a certain order. That is just wrong and goes against the
principals of a rdbms.

Just write your queries in such a way that the result is always returned the
way you want it regardless of the way it is ordered in the table.


Jack




2008/9/23 Trullo <[EMAIL PROTECTED]>

> En/na Chris ha escrit:
> > Trullo wrote:
> >> hello_world();
> >>
> >> in fact.. how to goTo next/previous row of a table without using
> >> incremental ids AND without reading the whole table?
> >> i will explain:
> >> I wanna do something like a paging toolbar blinded to a list of rows
> >> (for example, a literally view of a db table).
> >> The first difference from a normal paging system, is that i wanna show
> >> only one row per page, and luckily i know the id of that first viewed
> >> row; so, no problem until here. Im able to show the first row xD.
> >> The second difference is that i don't know the position of the first
> >> viewed row inside the whole original table, only the id of the row
> >> (maybe someone is laughing while reading 'only').
> >>
> >> I would like to know the position of that row to allow a easy goTo
> >> next/prev method using LIMIT/OFFSET sql clauses.
> >
> > Assuming the row id you have is a primary key, you could do:
> >
> > select * from table where primary_key > $current_rowid order by
> > primary_key asc limit 1;
> >
> >
> > For previous you could do:
> >
> > select * from table where primary_key < $current_rowid order by
> > primary_key desc limit 1;
> >
> Lot of thanks! its true that i dont care about the position of row. Your
> solution will do the work sure :o]
>
> As a curiosity... then.. the only way to know the position of a row,  is
> read the whole table?
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
J.A. van Zanen


Re: [PHP-DB] How to retrieve the position of a row inside a table with garbage data in all cloumns?

2008-09-22 Thread Trullo
En/na Chris ha escrit:
> Trullo wrote:
>> hello_world();
>>
>> in fact.. how to goTo next/previous row of a table without using
>> incremental ids AND without reading the whole table?
>> i will explain:
>> I wanna do something like a paging toolbar blinded to a list of rows
>> (for example, a literally view of a db table).
>> The first difference from a normal paging system, is that i wanna show
>> only one row per page, and luckily i know the id of that first viewed
>> row; so, no problem until here. Im able to show the first row xD.
>> The second difference is that i don't know the position of the first
>> viewed row inside the whole original table, only the id of the row
>> (maybe someone is laughing while reading 'only').
>>
>> I would like to know the position of that row to allow a easy goTo
>> next/prev method using LIMIT/OFFSET sql clauses.
>
> Assuming the row id you have is a primary key, you could do:
>
> select * from table where primary_key > $current_rowid order by
> primary_key asc limit 1;
>
>
> For previous you could do:
>
> select * from table where primary_key < $current_rowid order by
> primary_key desc limit 1;
>
Lot of thanks! its true that i dont care about the position of row. Your
solution will do the work sure :o]

As a curiosity... then.. the only way to know the position of a row,  is
read the whole table?

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



Re: [PHP-DB] How to retrieve the position of a row inside a table with garbage data in all cloumns?

2008-09-22 Thread Chris

Trullo wrote:

hello_world();

in fact.. how to goTo next/previous row of a table without using
incremental ids AND without reading the whole table?
i will explain:
I wanna do something like a paging toolbar blinded to a list of rows
(for example, a literally view of a db table).
The first difference from a normal paging system, is that i wanna show
only one row per page, and luckily i know the id of that first viewed
row; so, no problem until here. Im able to show the first row xD.
The second difference is that i don't know the position of the first
viewed row inside the whole original table, only the id of the row
(maybe someone is laughing while reading 'only').

I would like to know the position of that row to allow a easy goTo
next/prev method using LIMIT/OFFSET sql clauses.


Assuming the row id you have is a primary key, you could do:

select * from table where primary_key > $current_rowid order by 
primary_key asc limit 1;



For previous you could do:

select * from table where primary_key < $current_rowid order by 
primary_key desc limit 1;


--
Postgresql & php tutorials
http://www.designmagick.com/


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



[PHP-DB] How to retrieve the position of a row inside a table with garbage data in all cloumns?

2008-09-22 Thread Trullo
hello_world();

in fact.. how to goTo next/previous row of a table without using
incremental ids AND without reading the whole table?
i will explain:
I wanna do something like a paging toolbar blinded to a list of rows
(for example, a literally view of a db table).
The first difference from a normal paging system, is that i wanna show
only one row per page, and luckily i know the id of that first viewed
row; so, no problem until here. Im able to show the first row xD.
The second difference is that i don't know the position of the first
viewed row inside the whole original table, only the id of the row
(maybe someone is laughing while reading 'only').

I would like to know the position of that row to allow a easy goTo
next/prev method using LIMIT/OFFSET sql clauses.
But, since id's aren't incremental, and since i don't know the position
of that row, i cant find any way to know witch row is the next/prev.

I found a few solutions and it is poorly working now, reading the whole
table and thats all :o].
The front-end of the app, is not robust enough to fast-process this
amount of data (javascript), so this solution is a piece of .

I'm missing something?
How to retrieve the position of a row in a given table (always ordered
by ASC id) without reading more than one result per query using -only-
raw id's?

Thanks for your time.
Trullo :o]

P.S. Im using php526/mysql5051b but a generic answer is highly appreciated.

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



Re: [PHP-DB] How to import data from Oracle 10g to MySQL 5.0

2008-08-04 Thread landavia
how about convert into SQL file? then try to import using phpmyadmin?  
naren pendyal wrote:

Check out the tool Oracle Migration work bench

Regards,
Naren
www.bigfatprize.com

--- santoso berkah <[EMAIL PROTECTED]> wrote:

  

Dear friends,

I would ask to you about the tools or references for
importing data 
from Oracle 10g to MySQL 5.


Thank you for your kindness.

Regards,
im_id


  


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







  



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



Re: [PHP-DB] How to import data from Oracle 10g to MySQL 5.0

2008-08-04 Thread naren pendyal
Check out the tool Oracle Migration work bench

Regards,
Naren
www.bigfatprize.com

--- santoso berkah <[EMAIL PROTECTED]> wrote:

> Dear friends,
> 
> I would ask to you about the tools or references for
> importing data 
> from Oracle 10g to MySQL 5.
> 
> Thank you for your kindness.
> 
> Regards,
> im_id
> 
> 
>   
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



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



Re: [PHP-DB] How to import data from Oracle 10g to MySQL 5.0

2008-07-30 Thread Yves Sucaet
Depending on how much data we're talking about, the PHPMyAdmin may not be 
the best solution.


Microsoft SQL Server has a DTS (data transformation services) that will 
convert anything into anything (as long as *it* has a ODBC or OLEDB driver).


Yves

- Original Message - 
From: "santoso berkah" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, July 30, 2008 10:24 PM
Subject: [PHP-DB] How to import data from Oracle 10g to MySQL 5.0



Dear friends,

I would ask to you about the tools or references for importing data
from Oracle 10g to MySQL 5.

Thank you for your kindness.

Regards,
im_id




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






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



Re: [PHP-DB] How to import data from Oracle 10g to MySQL 5.0

2008-07-30 Thread Micah Gersten
Have you looked into PHPMyAdmin?
http://www.phpmyadmin.net/home_page/index.php

There's an option for importing an oracle sql file.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



santoso berkah wrote:
> Dear friends,
>
> I would ask to you about the tools or references for importing data 
> from Oracle 10g to MySQL 5.
>
> Thank you for your kindness.
>
> Regards,
> im_id
>
>
>   
>
>   

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



[PHP-DB] How to import data from Oracle 10g to MySQL 5.0

2008-07-30 Thread santoso berkah
Dear friends,

I would ask to you about the tools or references for importing data 
from Oracle 10g to MySQL 5.

Thank you for your kindness.

Regards,
im_id


  

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



RE: [PHP-DB] How to do a Newsletter

2008-05-01 Thread STEVEN CRUZ

Hello;

What exactly do you mean? I have some jobs in cron that run a query and then 
spit out an thml page via email. That type of thing?





From: Nasreen Laghari <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] How to do a Newsletter
Date: Thu, 1 May 2008 08:59:33 -0700 (PDT)

Hi,
Does any one know a better way of doing "Newsletter". I have to run a query 
and send that data to clients.

Regards


  


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ




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



Re: [PHP-DB] How to do a Newsletter

2008-05-01 Thread Jason Pruim
Without seeing any of your code to base it off of I'd select it like  
this:


$sql = "SELECT `email`, `emailNewsletter` FROM `mytable` where  
`emailNewsletter`='YES'";


then just loop through the array that gets returned...

while ($row = mysqli_fetch_assoc($result)) {
//build the e-mail


}

Obviously, there's more to it, but that should get you started. If you  
run into trouble, post code that we could look at and see if we can  
help you.




On May 1, 2008, at 12:17 PM, Nasreen Laghari wrote:

I have to email it. Basically I have run a query according to user  
criteria of newsletter and send it via email



- Original Message 
From: Jason Pruim <[EMAIL PROTECTED]>
To: Nasreen Laghari <[EMAIL PROTECTED]>
Cc: php-db@lists.php.net
Sent: Thursday, May 1, 2008 5:03:43 PM
Subject: Re: [PHP-DB] How to do a Newsletter

That's not an awful lot to go off of.. I'm assuming the actual
newsletter is already produced probably in a PDF?

Are you looking to e-mail it out?

Post it to a website?

Get e-mail addresses to e-mail it to?

Get postal addresses to postal mail it to?

More info I think would definitely help.


On May 1, 2008, at 11:59 AM, Nasreen Laghari wrote:


Hi,
Does any one know a better way of doing "Newsletter". I have to run
a query and send that data to clients.
Regards




Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[EMAIL PROTECTED]




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


  


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[EMAIL PROTECTED]




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



Re: [PHP-DB] How to do a Newsletter

2008-05-01 Thread Nasreen Laghari
I have to email it. Basically I have run a query according to user criteria of 
newsletter and send it via email


- Original Message 
From: Jason Pruim <[EMAIL PROTECTED]>
To: Nasreen Laghari <[EMAIL PROTECTED]>
Cc: php-db@lists.php.net
Sent: Thursday, May 1, 2008 5:03:43 PM
Subject: Re: [PHP-DB] How to do a Newsletter

That's not an awful lot to go off of.. I'm assuming the actual  
newsletter is already produced probably in a PDF?

Are you looking to e-mail it out?

Post it to a website?

Get e-mail addresses to e-mail it to?

Get postal addresses to postal mail it to?

More info I think would definitely help.


On May 1, 2008, at 11:59 AM, Nasreen Laghari wrote:

> Hi,
> Does any one know a better way of doing "Newsletter". I have to run  
> a query and send that data to clients.
> Regards
>
>
>      
> 
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.  
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[EMAIL PROTECTED]




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


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Re: [PHP-DB] How to do a Newsletter

2008-05-01 Thread Jason Pruim
That's not an awful lot to go off of.. I'm assuming the actual  
newsletter is already produced probably in a PDF?


Are you looking to e-mail it out?

Post it to a website?

Get e-mail addresses to e-mail it to?

Get postal addresses to postal mail it to?

More info I think would definitely help.


On May 1, 2008, at 11:59 AM, Nasreen Laghari wrote:


Hi,
Does any one know a better way of doing "Newsletter". I have to run  
a query and send that data to clients.

Regards


  


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[EMAIL PROTECTED]




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



[PHP-DB] How to do a Newsletter

2008-05-01 Thread Nasreen Laghari
Hi,
Does any one know a better way of doing "Newsletter". I have to run a query and 
send that data to clients. 
Regards


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Re: [PHP-DB] How to recognize which 'case' is being echoed by switch statement

2008-02-22 Thread Daniel Brown
On Fri, Feb 22, 2008 at 6:01 AM, Tim Daff <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  This is my first time using php in my site navigation, I have the code
>  for all the pages in one file and I am using the switch statement to
>  change between them.
[snip!]

None of your code included a case/switch piece.  This is probably
what you mean:

";
break;
case "portfolio.php":
$css = "";
break;
case "whoweare.php":
$css = "";
break;
default:
$css = "";
break;
}
?>

-- 


Daniel P. Brown
Senior Unix Geek


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



RES: [PHP-DB] How to recognize which 'case' is being echoed by switch statement

2008-02-22 Thread Thiago Pojda
Quite sure this is not what you mean:

>  $page = case;
>  if ( $page = "contact" ) { 

but instead

>  $page = case;
>  if ( $page == "contact" ) { 



-Mensagem original-
De: Stut [mailto:[EMAIL PROTECTED] 
Enviada em: sexta-feira, 22 de fevereiro de 2008 09:31
Para: Tim Daff
Cc: php-db@lists.php.net
Assunto: Re: [PHP-DB] How to recognize which 'case' is being echoed by
switch statement

On 22 Feb 2008, at 11:01, Tim Daff wrote:
>  $page = case;
>   if ( $page = "contact" ) {
>   echo ""; }
>   
>   else  {
>   echo "Contact a>"; }
>   ?>


$page = case; will be raising a notice which you're obviously not seeing.
So, step 1 is to edit PHP.ini on your development machine so error_reporting
is E_ALL, and display_errors is on. You'll need to restart your web server
for this change to take effect.

The case keyword is not valid outside a switch block. What you want to be
doing is comparing "contact" etc with $_GET['page'] which is the variable
the switch statement is using.

Additionally you are using a single = which is the assignment operator, so
each if statement is assigning the quoted string to $page not testing for
it. You need to use == to do that.

I would suggest you buy a book on PHP for beginners, or Google for an
introductory tutorial because these are pretty basic syntax mistakes.

-Stut

--
http://stut.net/

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

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



Re: [PHP-DB] How to recognize which 'case' is being echoed by switch statement

2008-02-22 Thread Stut


On 22 Feb 2008, at 11:01, Tim Daff wrote:

"; }

else  {
		echo "Contacta>"; }

?>



$page = case; will be raising a notice which you're obviously not  
seeing. So, step 1 is to edit PHP.ini on your development machine so  
error_reporting is E_ALL, and display_errors is on. You'll need to  
restart your web server for this change to take effect.


The case keyword is not valid outside a switch block. What you want to  
be doing is comparing "contact" etc with $_GET['page'] which is the  
variable the switch statement is using.


Additionally you are using a single = which is the assignment  
operator, so each if statement is assigning the quoted string to $page  
not testing for it. You need to use == to do that.


I would suggest you buy a book on PHP for beginners, or Google for an  
introductory tutorial because these are pretty basic syntax mistakes.


-Stut

--
http://stut.net/

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



[PHP-DB] How to recognize which 'case' is being echoed by switch statement

2008-02-22 Thread Tim Daff

Hi,

This is my first time using php in my site navigation, I have the code  
for all the pages in one file and I am using the switch statement to  
change between them.


This is working great but I am now trying to change the css id of the  
current page's navbar link.  How do I get my script to recognize which  
case is currently being echoed by the switch statement?


If you want to see the page in action without php in the navbar visit  
here: http://www.publikdesign.com



Here is the code:



















"; }

else  {
		echo "Contacta>"; }

?>

"; }

else {
		echo "\">Portfolio"; }

?>

"; }

else {
echo "Home"; }

?>



  




















Phone 0437 988 399

eMail mailto:[EMAIL PROTECTED] 
\">[EMAIL PROTECTED]













";
break;

case "portfolio":
echo "




alt=\"Portfolio\" />


  
Development Lofo\"  />
\">Click to Expand

  


\"Katmandog Logo\"  />
http://www.katmandog.biz 
\" target=\"_blank\">Click to visit website




  








\"Island Healing Logo\"  />
Click  
to Expand




\"Roaming Earth Logo\"  />
Click  
to Expand



";
break;

case "home":
echo "




Design Services\" width=\"327\" height=\"28\" />
Publik provides a full range of graphic design  
services, from business cards and letterheaders, to product catalogues  
and promotional brochures. We will bring your project from concept to  
print in the most cost effective and professional manner.

  


\" />
The world wide web has grown into the most  
powerful marketing tool available to a business. From a concreter to a  
department store, the internet can not be overlooked as an important  
tool in bringing clients to your business. Publik Design provides all  
manner of web services from static pages to fully dynamic web  
applications.











Business Card Design\" />




\"Katmandog Pet Shop Thumbnail\" />



";
break;

case "kdev":
echo "




alt=\"Portfolio\" />

Back


\"K Development\"  />





";
break;

case "isl":
echo "




  \"Portfolio\" />

  Back

\"K Development\"  />






  ";
break;

case "re":
echo "




  \"Portfolio\" />

  Back

Development\"  />





  ";
break;

default:
echo "




Design Services\" width=\"327\" height=\"28\" />
Publik provides a full range of graphic design  
services, from business cards and letterheaders, to product catalogues  
and promotional brochures. We will bring your project from concept to  
print in the most cost effective and professional manner.

  


\" 

Re: [PHP-DB] How to Parse XML Feed on my PHP page

2008-02-13 Thread Vikas Jayna

Take a look at the pear XML_Feed_Parser package at
http://pear.php.net/package/XML_Feed_Parser for parsing Atom & RSS feeds

For parsing normal xml documents try XML_Parser package
http://pear.php.net/package/XML_Parser

Vikas Jayna


Chris Carter wrote:
> 
> Hi,
> 
> I have never done parsing of an XML feed or URL on my PHP page. Basically
> there is a website that shows products, in order to list those products on
> your page you need to parse the XML URL that they provide.
> 
> I have no experience to this, have been searching on this but have not got
> a clue. Seeking an advice as to how can I really get to show those
> products on my PHP page.
> 
> Example URL is:
> 
> http://xmlfeeds.somesite.com/?p=12345&f=123&s=gifts
> 
> Thanks in advance,
> 
> Chris
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-Parse-XML-Feed-on-my-PHP-page-tp15471880p15475221.html
Sent from the Php - Database mailing list archive at Nabble.com.

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



[PHP-DB] How to Parse XML Feed on my PHP page

2008-02-13 Thread Chris Carter

Hi,

I have never done parsing of an XML feed or URL on my PHP page. Basically
there is a website that shows products, in order to list those products on
your page you need to parse the XML URL that they provide.

I have no experience to this, have been searching on this but have not got a
clue. Seeking an advice as to how can I really get to show those products on
my PHP page.

Example URL is:

http://xmlfeeds.somesite.com/?p=12345&f=123&s=gifts

Thanks in advance,

Chris
-- 
View this message in context: 
http://www.nabble.com/How-to-Parse-XML-Feed-on-my-PHP-page-tp15471880p15471880.html
Sent from the Php - Database mailing list archive at Nabble.com.

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



[PHP-DB] How to get last insert id safely?

2007-12-05 Thread Jacky
Hi All,
How to get last insert id safely in php with persistent connection to 
mysql?because there may be larger concurrence requests to the php to query 
insert statements.Example,the php query following two sql statements:

mysql_query("insert into tb(id,name) values(null,$username)");
$res = mysql_query("select last_insert_id()");

And in any time,user A insert one row to the table tb,and the same time 
before user A query last_insert_id(),user B insert another row to the same 
table too.
In this situation,will user A or B query last_insert_id() function get the 
correct id for he/her just insert?

Any ideas?Thanks!

Regards
Jacky 

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



RE: [PHP-DB] how to store a heirarchy of resellers and customers WAS: newbie help

2007-10-01 Thread Daevid Vincent
Also, you really should use a more descriptive subject line, 'newbie help'
is kind of weak. If everyone did that, nobody would be able to search
subjects or distinguish one topic from another. 

I won't even get into the whole 'top/bottom post' B.S. (personally I think
top posting is great as you don't have to scroll. So you read bottom up if
you want to know the thread) Ooops. Sorry. I guess I did get into it a bit.
;-p

Something like, "how to store a heirarchy of resellers and customers"

> > -Original Message-
> > From: nhadie [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, September 27, 2007 8:31 PM
> > To: php-db@lists.php.net
> > Subject: [PHP-DB] newbie help
> > 
> > Hi All,
> > 
> > I would like to setup a system something like this
> > 
> >   
> >   
> >  customer A
> >   
> >   
> >   /\
> >   
> > 
> >   cust 1cust 2
> >   
> > 
> >  /  \  \
> > 
>  
> > cust B   cust C  cust D
> > 
> > customer A has customer 1 and 2, cust 1 has cust B and C etc, etc.
> > what i'm after is when a  customer user logs in he can only 
> > see record 
> > of its customer, e.g cust A logs in, it can only see records 
> > of cust 1 and cust 2,
> > if cust 2 is login it can only see cust D and so on
> > 
> > how would i approach this? should every customer have it's 
> > own database,
> > consisting of all tables i need e.g customer detail table,
> > and i will use the database name as session variable, so  
> > that when they 
> > add records it be inserted on table under that database?
> > 
> > sorry if my questions are confusing, hope anyone can help 
> me, i just 
> > need help on how to approach it at the beginning so it will 
> > not be messy 
> > later on. Thank you.
> > 
> > Regards,
> > Nhadie
> > 
> > -- 
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



RE: [PHP-DB] How to capture from session and match database

2007-09-23 Thread Naintara
Hi Chris,

What I had sent earlier were some hints, references and some code.
I had recommended reading up on sessions, because it's good to know and
useful to get a handle on it, you'll be able to do these things easily
then.

If you are pressed for time and unable to do so, here is some code you
could use
Do read my comments after // (slashes)



Naintara

-Original Message-
From: Chris Carter [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 23, 2007 9:59 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] How to capture from session and match database


Hi Naintara,

thanks for your code could you please advice why is the code giving this
error.

"Parse error: syntax error, unexpected T_ISSET in
/path/submit-store-details.php on line 4"

This is coming when I am trying to use your code like this:



and then retrieving it in SQL query:

$query="SELECT * FROM table WHERE email =
'".mysql_real_escape_string($_SESSION['email'])."'";

Many thanks.

Chris

Chris Carter wrote:
> 
> Hi,
> 
> I have this session code on each page and this is working fine for
> authentication:
> 
>  session_start();
> if(!session_is_registered(email)){
> header("location:store-login.php");
> }
> ?>
> 
> Now I wish to 
> 
> 1)capture the value (userName) from session on one of my pages and 
> 2)match it with the database and 
> 3)display the value in the textfields
> 
> This is the code I am using to do this please:
> 
> include "../includes/malls_db_conf.php";
> 
> $query="SELECT * FROM table WHERE email = '$email'"; < Here I am
> capturing from the session
> $result=mysql_query($query);
> $num=mysql_numrows($result);
> 
> mysql_close();
> {
> 
> $shopname=mysql_result($result,$i,"shopname");
> $category=mysql_result($result,$i,"category");
> 
> }
> 
> ?>
> 
> Showing in the textfield from the database is working fine
> 
> THE Problem is:
> 
> I am getting only the first row of table to show up and not the one with
> the field $userName, meaning the userName is not getting captured from
the
> above or checking with the table and showing me the value. 
> 
> It might be a basic one, could you please advice how to achieve that.
> 
> Cheers,
> 
> Chris
> 
Quoted from: 
http://www.nabble.com/How-to-capture-from-session-and-match-database-tf4478
519.html#a12770056


Chris Carter wrote:
> 
> Hi,
> 
> I have this session code on each page and this is working fine for
> authentication:
> 
>  session_start();
> if(!session_is_registered(email)){
> header("location:store-login.php");
> }
> ?>
> 
> Now I wish to 
> 
> 1)capture the value (userName) from session on one of my pages and 
> 2)match it with the database and 
> 3)display the value in the textfields
> 
> This is the code I am using to do this please:
> 
> include "../includes/malls_db_conf.php";
> 
> $query="SELECT * FROM table WHERE email = '$email'"; < Here I am
> capturing from the session
> $result=mysql_query($query);
> $num=mysql_numrows($result);
> 
> mysql_close();
> {
> 
> $shopname=mysql_result($result,$i,"shopname");
> $category=mysql_result($result,$i,"category");
> 
> }
> 
> ?>
> 
> Showing in the textfield from the database is working fine
> 
> THE Problem is:
> 
> I am getting only the first row of table to show up and not the one with
> the field $userName, meaning the userName is not getting captured from
the
> above or checking with the table and showing me the value. 
> 
> It might be a basic one, could you please advice how to achieve that.
> 
> Cheers,
> 
> Chris
> 

-- 
View this message in context:
http://www.nabble.com/How-to-capture-from-session-and-match-database-tf4478
519.html#a12847962
Sent from the Php - Database mailing list archive at Nabble.com.

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

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



Re: [PHP-DB] How to capture from session and match database

2007-09-23 Thread Chris Carter

Hi Naintara,

thanks for your code could you please advice why is the code giving this
error.

"Parse error: syntax error, unexpected T_ISSET in
/path/submit-store-details.php on line 4"

This is coming when I am trying to use your code like this:



and then retrieving it in SQL query:

$query="SELECT * FROM table WHERE email =
'".mysql_real_escape_string($_SESSION['email'])."'";

Many thanks.

Chris

Chris Carter wrote:
> 
> Hi,
> 
> I have this session code on each page and this is working fine for
> authentication:
> 
>  session_start();
> if(!session_is_registered(email)){
> header("location:store-login.php");
> }
> ?>
> 
> Now I wish to 
> 
> 1)capture the value (userName) from session on one of my pages and 
> 2)match it with the database and 
> 3)display the value in the textfields
> 
> This is the code I am using to do this please:
> 
> include "../includes/malls_db_conf.php";
> 
> $query="SELECT * FROM table WHERE email = '$email'"; < Here I am
> capturing from the session
> $result=mysql_query($query);
> $num=mysql_numrows($result);
> 
> mysql_close();
> {
> 
> $shopname=mysql_result($result,$i,"shopname");
> $category=mysql_result($result,$i,"category");
> 
> }
> 
> ?>
> 
> Showing in the textfield from the database is working fine
> 
> THE Problem is:
> 
> I am getting only the first row of table to show up and not the one with
> the field $userName, meaning the userName is not getting captured from the
> above or checking with the table and showing me the value. 
> 
> It might be a basic one, could you please advice how to achieve that.
> 
> Cheers,
> 
> Chris
> 
Quoted from: 
http://www.nabble.com/How-to-capture-from-session-and-match-database-tf4478519.html#a12770056


Chris Carter wrote:
> 
> Hi,
> 
> I have this session code on each page and this is working fine for
> authentication:
> 
>  session_start();
> if(!session_is_registered(email)){
> header("location:store-login.php");
> }
> ?>
> 
> Now I wish to 
> 
> 1)capture the value (userName) from session on one of my pages and 
> 2)match it with the database and 
> 3)display the value in the textfields
> 
> This is the code I am using to do this please:
> 
> include "../includes/malls_db_conf.php";
> 
> $query="SELECT * FROM table WHERE email = '$email'"; < Here I am
> capturing from the session
> $result=mysql_query($query);
> $num=mysql_numrows($result);
> 
> mysql_close();
> {
> 
> $shopname=mysql_result($result,$i,"shopname");
> $category=mysql_result($result,$i,"category");
> 
> }
> 
> ?>
> 
> Showing in the textfield from the database is working fine
> 
> THE Problem is:
> 
> I am getting only the first row of table to show up and not the one with
> the field $userName, meaning the userName is not getting captured from the
> above or checking with the table and showing me the value. 
> 
> It might be a basic one, could you please advice how to achieve that.
> 
> Cheers,
> 
> Chris
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-capture-from-session-and-match-database-tf4478519.html#a12847962
Sent from the Php - Database mailing list archive at Nabble.com.

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



RE: [PHP-DB] How to capture from session and match database

2007-09-19 Thread Naintara
Hi,

First of all, where you are storing the session variable, it should be
specified as:
$_SESSION['email'] = 'email value' //PHP 4.1.0 onwards

This is preferred to registering global variables. There's a whole lot of
discussion on why.

On the pages you are authenticating, you would correspondingly check for a
value in $_SESSION['email']

!empty($_SESSION['email']) isset($_SESSION['email']) etc, depending on you.

When you code for the session logout, you need to look up the php manual
for session_destroy().

When you would like to retrieve data for a user, you can get the details by
using code like this:
$query="SELECT * FROM table WHERE email = '".
mysql_real_escape_string($_SESSION['email']). "'"; 

I would suggest you read up a good tutorial on php + mysql

I am not sure why there are curly braces after mysql_close(); or where you
are setting values to $i

mysql_close();
{

$shopname=mysql_result($result,$i,"shopname");
$category=mysql_result($result,$i,"category");

}

The best thing would be to first understand sessions, set variables, echo
values, destroy variables, and then test the sql. 

-Original Message-
From: Chris Carter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 19, 2007 8:34 AM
To: php-db@lists.php.net
Subject: [PHP-DB] How to capture from session and match database


Hi,

I have this session code on each page and this is working fine for
authentication:



Now I wish to 

1)capture the value (userName) from session on one of my pages and 
2)match it with the database and 
3)display the value in the textfields

This is the code I am using to do this please:

include "../includes/malls_db_conf.php";

$query="SELECT * FROM table WHERE email = '$email'"; < Here I am
capturing from the session
$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
{

$shopname=mysql_result($result,$i,"shopname");
$category=mysql_result($result,$i,"category");

}

?>

Showing in the textfield from the database is working fine

THE Problem is:

I am getting only the first row of table to show up and not the one with
the
field $userName, meaning the userName is not getting captured from the
above
or checking with the table and showing me the value. 

It might be a basic one, could you please advice how to achieve that.

Cheers,

Chris
-- 
View this message in context:
http://www.nabble.com/How-to-capture-from-session-and-match-database-tf4478
519.html#a12770056
Sent from the Php - Database mailing list archive at Nabble.com.

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

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



Re: [PHP-DB] How to capture from session and match database

2007-09-19 Thread Goltsios Theodore


You can use cookies to keep your info so that you don't pass them from 
page to page. A way to do this is:

$email = '[EMAIL PROTECTED]';
session_start();
setcookie('e-mail',$email);

And then retrieve the cookie information using the $_COOKIE array:

$query="SELECT * FROM table WHERE email = '".$_COOKIE['e-mail']."'";

Every browser keeps information about the cookies that already has 
accepted. If this is to work for you then check your browser to see if 
the cookie exists and keeps all that you need. A good idea is to erase 
the previous cookies accepted from your web server.



Chris Carter wrote:

Hi,

I have this session code on each page and this is working fine for
authentication:



Now I wish to 

1)capture the value (userName) from session on one of my pages and 
2)match it with the database and 
3)display the value in the textfields


This is the code I am using to do this please:

include "../includes/malls_db_conf.php";

$query="SELECT * FROM table WHERE email = '$email'"; < Here I am
capturing from the session
$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
{

$shopname=mysql_result($result,$i,"shopname");
$category=mysql_result($result,$i,"category");

}

?>

Showing in the textfield from the database is working fine

THE Problem is:

I am getting only the first row of table to show up and not the one with the
field $email, meaning the emailis not getting captured from the above or
checking with the table and showing me the value. 


It might be a basic one, could you please advice how to achieve that.

Cheers,

Chris
  


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



[PHP-DB] How to capture from session and match database

2007-09-18 Thread Chris Carter

Hi,

I have this session code on each page and this is working fine for
authentication:



Now I wish to 

1)capture the value (userName) from session on one of my pages and 
2)match it with the database and 
3)display the value in the textfields

This is the code I am using to do this please:

include "../includes/malls_db_conf.php";

$query="SELECT * FROM table WHERE email = '$email'"; < Here I am
capturing from the session
$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
{

$shopname=mysql_result($result,$i,"shopname");
$category=mysql_result($result,$i,"category");

}

?>

Showing in the textfield from the database is working fine

THE Problem is:

I am getting only the first row of table to show up and not the one with the
field $email, meaning the emailis not getting captured from the above or
checking with the table and showing me the value. 

It might be a basic one, could you please advice how to achieve that.

Cheers,

Chris
-- 
View this message in context: 
http://www.nabble.com/How-to-capture-from-session-and-match-database-tf4478520.html#a12770057
Sent from the Php - Database mailing list archive at Nabble.com.

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



[PHP-DB] How to capture from session and match database

2007-09-18 Thread Chris Carter

Hi,

I have this session code on each page and this is working fine for
authentication:



Now I wish to 

1)capture the value (userName) from session on one of my pages and 
2)match it with the database and 
3)display the value in the textfields

This is the code I am using to do this please:

include "../includes/malls_db_conf.php";

$query="SELECT * FROM table WHERE email = '$email'"; < Here I am
capturing from the session
$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
{

$shopname=mysql_result($result,$i,"shopname");
$category=mysql_result($result,$i,"category");

}

?>

Showing in the textfield from the database is working fine

THE Problem is:

I am getting only the first row of table to show up and not the one with the
field $userName, meaning the userName is not getting captured from the above
or checking with the table and showing me the value. 

It might be a basic one, could you please advice how to achieve that.

Cheers,

Chris
-- 
View this message in context: 
http://www.nabble.com/How-to-capture-from-session-and-match-database-tf4478519.html#a12770056
Sent from the Php - Database mailing list archive at Nabble.com.

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



Re: [PHP-DB] how to avoid showing warnings

2007-09-12 Thread Chris



Warning: mysql_query(): Your query requires a full tablescan (table 
Mobile_Tunes, 4 rows affected). Use EXPLAIN to optimize your query. in 
D:\Program Files\Apache Group\Apache2\htdocs\Breez\mtunes_main.php on line 47
   
  Warning: mysql_query(): Your query requires a full tablescan (table Mobile_Tunes, 4 rows affected). Use EXPLAIN to optimize your query. in D:\Program Files\Apache Group\Apache2\htdocs\Breez\mtunes_main.php on line 70
   
   
  

  this table will be populated with at least 60,000 records. these 4 records 
are just for testing purpose.
  so if you can tell me what to do to avoid this warning, then it will be great 
help for me.


If you're selecting all rows from the table (bad idea for 60,000 rows), 
then you won't be able to avoid it.


If you want to select a portion of the rows, create an index on the 
relevant fields.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] how to avoid showing warnings

2007-09-11 Thread Asim
Hi
   
  
i am including table structure and other results to you
   
   
  CREATE TABLE Mobile_Tunes
(
Tune_ID int(6) NOT NULL AUTO_INCREMENT,
Tune_Name varchar(30) NOT NULL,
Tune_Type varchar(10) NOT NULL,
PRIMARY KEY (Tune_ID),
UNIQUE KEY Tune_Name (Tune_Name),
INDEX Tune_Type (Tune_Type)
)ENGINE=MyISAM;
   
  
mysql> desc mobile_tunes;
+---+-+--+-+-++
| Field | Type| Null | Key | Default | Extra  |
+---+-+--+-+-++
| Tune_ID   | int(6)  |  | PRI | NULL| auto_increment |
| Tune_Name | varchar(30) |  | UNI | ||
| Tune_Type | varchar(10) |  | MUL | ||
+---+-+--+-+-++
3 rows in set (0.03 sec)
   
   
  mysql> explain select Tune_name, tune_type from mobile_tunes;
+--+--+---+--+-+--+--+---+
| table| type | possible_keys | key  | key_len | ref  | rows | Extra |
+--+--+---+--+-+--+--+---+
| mobile_tunes | ALL  | NULL  | NULL |NULL | NULL |4 |   |
+--+--+---+--+-+--+--+---+
1 row in set (0.02 sec)
   
   
  mysql> select Tune_name, tune_type from mobile_tunes;
+---+---+
| Tune_name | tune_type |
+---+---+
| pakistani | midi  |
| pakistan2 | midi  |
| usa   | midi  |
| uk| midi  |
+---+---+
4 rows in set (0.01 sec)
   
   
   
  ISSUED WARNINGS

  
Warning: mysql_query(): Your query requires a full tablescan (table 
Mobile_Tunes, 4 rows affected). Use EXPLAIN to optimize your query. in 
D:\Program Files\Apache Group\Apache2\htdocs\Breez\mtunes_main.php on line 47
   
  Warning: mysql_query(): Your query requires a full tablescan (table 
Mobile_Tunes, 4 rows affected). Use EXPLAIN to optimize your query. in 
D:\Program Files\Apache Group\Apache2\htdocs\Breez\mtunes_main.php on line 70
   
   
  
  this table will be populated with at least 60,000 records. these 4 records 
are just for testing purpose.
  so if you can tell me what to do to avoid this warning, then it will be great 
help for me.
  
Bye
   
   
   
  

Niel Archer <[EMAIL PROTECTED]> wrote:
  > > This shows you have NO indexes on the table. Assuming that 'Tune_Name'
> > contains unique entries for each row, I'd suggest you do the following
> > as a minimum:
> >
> > ALTER TABLE Mobile_Tunes ADD PRIMARY KEY (Tune_Name);
> 
> How's that going to help if he's getting all records from the table?

Depends what you mean by help.
Improve performance of the query, not at all, but that wasn't the
original question. 
In a previous post he said he'd added indexes which his EXPLAIN output
clearly shows is not the case. That is simply an example of how to add
a PRIMARY KEY after creating the table. However, it will stop duplicate
entries from being entered and prepare the way for when he's NOT
selecting all rows, so is not entirely wasted.

> Also there's no way a database is going to use an index if there are
> only 4 rows in the table.

True, but if it was only ever going to have 4 entries in it I doubt he'd
be using a Db at all. I'm assuming this is just a sample.

--
Niel Archer

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




Asim Jamil  - 0092 345 4025907, Pakistan
   
-
Shape Yahoo! in your own image.  Join our Network Research Panel today!

[PHP-DB] How to test PHP form for proper input

2007-08-03 Thread Phil Matt
I've got a mail form that automatically pulls in the addressee from a MySQL db, 
and lets the sender
fill in his/her own info before sending. I figured out how to set up tests for 
legal input in the
different fields, but I don't know how to incorporate the test results into my 
form submission code.
(Sorry for the dumb question, but I'm not an experienced PHP coder...)

Here the basic stuff:

//SENDS MAIL
\r\n" .
"Reply-to: $from_email\r\n" .   
"X-Mailer: PHP/" . phpversion());
echo "Your message has been sent!";}
?>
//FORM USED



Send e-mail to: 

  Your Name
  


  Your Email Address
  


  Subject
  


Message
  



  
  
  
  


  

//TESTING CODE


TIA for your help!

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



Re: [PHP-DB] how to delete

2007-06-19 Thread Niel Archer
Hi

There is no DESTROYIMAGE() function. May be you mean imagedestroy(). If
so this does NOT erase files, it destroys in memory images created using
the Image functions.

  To erase files use the unlink function. For detail look here 
http://uk3.php.net/unlink

Niel

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



Re: [PHP-DB] how to delete

2007-06-19 Thread bedul
unlink
(PHP 3, PHP 4, PHP 5)

unlink -- Deletes a file
Description
bool unlink ( string filename [, resource context] )


Deletes filename. Similar to the Unix C unlink() function.
Returns TRUE on success or FALSE on failure.

  : As of PHP 5.0.0 unlink() can also be used with some
URL wrappers. Refer to  M for a listing of which
wrappers support unlink().

  : Context support was added with PHP 5.0.0. For a
description of contexts, refer to   CL, Stream
Functions.

See also rmdir() for removing directories.


tes it out...

instead using CAPITAL.. u can use "this text mean bold" (use
" ")
- Original Message -
From: "Asim" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, June 19, 2007 12:08 PM
Subject: [PHP-DB] how to delete


> HI
>
>   can you tell me how to delete images from HARD DISK OR
WEB SPACE by using php?
>
>   i have created tumbnails of some images and they are
stored on HARD DISK IN PRESCRIBED FOLDER. now i use
>
>DESTROYIMAGE();
>
>   FUNCTION in php but it didnot delete crearted thumbnails
of prescribed folder. i am doing this to save webspace.
>
>   moreover, is there any way to create THUMBNAILS WITHOUT
SAVING IMAGES WITH NEW SIZE ON HARD DISK?
>
>
>   BYE
>
>
> Asim Jamil  - 0092 345 4025907, Pakistan
>
> -
> Yahoo! oneSearch: Finally,  mobile search that gives
answers, not web links.

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



[PHP-DB] how to delete

2007-06-18 Thread Asim
HI
   
  can you tell me how to delete images from HARD DISK OR WEB SPACE by using php?
   
  i have created tumbnails of some images and they are stored on HARD DISK IN 
PRESCRIBED FOLDER. now i use 
   
   DESTROYIMAGE();
   
  FUNCTION in php but it didnot delete crearted thumbnails of prescribed 
folder. i am doing this to save webspace.
   
  moreover, is there any way to create THUMBNAILS WITHOUT SAVING IMAGES WITH 
NEW SIZE ON HARD DISK?
   
   
  BYE


Asim Jamil  - 0092 345 4025907, Pakistan
   
-
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links. 

Re: [PHP-DB] How to call image from mySql to php file

2007-02-21 Thread Chris

Chris Carter wrote:

I have a field in database called "logos" which has one value
"images/logos/some_logo.jpg"

In my php I am trying to call it in my php file as image. With this code.

 $sno = $_REQUEST['sno'];

$query="SELECT logos FROM table WHERE sno = '$sno'";


Please please please read http://www.phpsec.org/

particularly

http://phpsec.org/projects/guide/3.html#3.2

--
Postgresql & php tutorials
http://www.designmagick.com/

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



RE: [PHP-DB] How to call image from mySql to php file

2007-02-21 Thread Bastien Koert

Simple, just add the image tag around it

$query="SELECT logos FROM table WHERE sno = '$sno'";

$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
$logos=mysql_result($result,$i,"logos");

echo "

 
";

Bastien

From: Chris Carter <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] How to call image from mySql to php file
Date: Wed, 21 Feb 2007 03:26:44 -0800 (PST)


I have a field in database called "logos" which has one value
"images/logos/some_logo.jpg"

In my php I am trying to call it in my php file as image. With this code.

 $sno = $_REQUEST['sno'];

$query="SELECT logos FROM table WHERE sno = '$sno'";

$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
$logos=mysql_result($result,$i,"logos");

echo "

 $logos 
";

?>

But getting errors. What is the way to call image in php file from the
database. I know that this is a very basic question but first time for me. 
I

ignored this in the begining but now its right infront of me.

Please advice.

Chris
--
View this message in context: 
http://www.nabble.com/How-to-call-image-from-mySql-to-php-file-tf3266161.html#a9079259

Sent from the Php - Database mailing list archive at Nabble.com.

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



_
Your Space. Your Friends. Your Stories. Share your world with Windows Live 
Spaces. http://spaces.live.com/?mkt=en-ca


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



[PHP-DB] How to call image from mySql to php file

2007-02-21 Thread Chris Carter

I have a field in database called "logos" which has one value
"images/logos/some_logo.jpg"

In my php I am trying to call it in my php file as image. With this code.

 $sno = $_REQUEST['sno'];

$query="SELECT logos FROM table WHERE sno = '$sno'";

$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
$logos=mysql_result($result,$i,"logos");

echo "

 $logos 
";

?>

But getting errors. What is the way to call image in php file from the
database. I know that this is a very basic question but first time for me. I
ignored this in the begining but now its right infront of me. 

Please advice.

Chris
-- 
View this message in context: 
http://www.nabble.com/How-to-call-image-from-mySql-to-php-file-tf3266161.html#a9079259
Sent from the Php - Database mailing list archive at Nabble.com.

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



Re: [PHP-DB] How to tell if a field type is auto_increment

2007-02-03 Thread John L. Creed
Ahhh, thanks. I'll do that.

-- 
Regards,
John L. Creed
pcExpressWay Consulting
*
dBASE Gold Charter Member 210
*
http://www.pcexpressway.com
*
"Niel Archer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi John,
>
> I'd suggest searching within the Extra field instead of testing for the
> value explicitly, as this field can theoretically hold several extra
> pieces of information.
>
> Niel 

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



Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-30 Thread Niel Archer
Hi John,

I'd suggest searching within the Extra field instead of testing for the
value explicitly, as this field can theoretically hold several extra
pieces of information.

Niel

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



Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-30 Thread John L. Creed
Here's what I did wih your help:

function isAutoinc($table,$fieldname){
 // returns 0 if false, 1 if true
 $breturn = 0;
 $sql = "SHOW COLUMNS FROM $table LIKE '$fieldname%' ";
   $result = mysql_query($sql) or die("Couldn't open table");
 // check column Extra
   $row = mysql_fetch_array( $result );
   if( $row["Extra"] == "auto_increment" ){
 $breturn = 1;
   }
   mysql_free_result($result);
   return $breturn;
}

Thanks again!!!

-- 
Regards,
John L. Creed
pcExpressWay Consulting
*
dBASE Gold Charter Member 210
*
http://www.pcexpressway.com
*
"Niel Archer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi
>
> Try using:
> SHOW COLUMNS FROM db.table LIKE 'field_name%'
>
> and from the returned row, check the 'Extra' column for 'auto_increment'
>
> Niel 

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



Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-29 Thread John L. Creed
Thanks a Million my Friend. I've been struggling with this for days now 



-- 
Regards,
John L. Creed
pcExpressWay Consulting
*
dBASE Gold Charter Member 210
*
http://www.pcexpressway.com
*
"Niel Archer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi
>
> Try using:
> SHOW COLUMNS FROM db.table LIKE 'field_name%'
>
> and from the returned row, check the 'Extra' column for 'auto_increment'
>
> Niel 

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



Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-29 Thread Niel Archer
Hi

Try using:
 SHOW COLUMNS FROM db.table LIKE 'field_name%'

and from the returned row, check the 'Extra' column for 'auto_increment'

Niel

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



[PHP-DB] How to tell if a field type is auto_increment

2007-01-29 Thread John L. Creed
I've been struggling to figure a way to determine if a mySql filed type is 
auto inc.
Any ideas?

Iv'e written a function that will INSERT form data which has the exact field 
names as the mysql table, thus looping through the table names and then 
building a query string for the insert. However I'd like to skip a field 
that's autoinc. That can be done if there's no hidden field in the form with 
the same name. I've created another function that updates a table but only 
with values in the http form that have changed, using the same logic as 
above, except I have to have a hidden field of the autoinc field so I know 
whcih row to update. Obviously the autoinc field won't be changed.

Thanks a million in advance.

-- 
Regards,
John L. Creed
pcExpressWay Consulting
*
dBASE Gold Charter Member 210
*
http://www.pcexpressway.com
* 

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



RE: [PHP-DB] How to stop the server timing out

2006-10-04 Thread David Skyers
Hi,

Thanks, the echos causes the page to responds after each insert, so the
server no longer times out.

David 

-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: 04 October 2006 03:24
To: David Skyers; php-db@lists.php.net
Subject: RE: [PHP-DB] How to stop the server timing out

You need to just start adding echo statements to the code to see where
the hang up is

Bastien


>From: "David Skyers" <[EMAIL PROTECTED]>
>To: 
>Subject: [PHP-DB] How to stop the server timing out
>Date: Tue, 3 Oct 2006 11:51:30 +0100
>
>Hi,
>
>I have written a php page and every time I run it, it causes the server

>to times-out. Is there anything I can do, to get the page to run 
>completely or speed up how the page works. Please note I do not have 
>any control over the server.
>
>The page does a select from a table and inserts the data into another 
>table. However it times-out half way through inserting.
>
>The code is attached.
>
>Thanks,
>
>David
>
>
>David Skyers
>Support Analyst
>Management Systems, EISD, UCL
>Extension: 41849
>Tel: 020 7679 1849
>Email: [EMAIL PROTECTED]
>
>


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

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



Re: [PHP-DB] How to stop the server timing out

2006-10-04 Thread OKi98

Hi,

> Is there anything I can do, to get the page to run completely
sure, contact the hosting company to prolong the maximum execution time 
on that script


> or speed up how the page works
maybe, but I dont see the source code

> The page does a select from a table and inserts the data into another 
table

do you use insert ... select syntax?

OKi98

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



Re: [PHP-DB] How to stop the server timing out

2006-10-03 Thread Szymon Fornal
hmm, you can edit your php.ini there is max_execution_time or in header 
of your php file put  *ini_set* ( "max_execution_time", string newvalue )


Bastien Koert napisał(a):
You need to just start adding echo statements to the code to see where 
the hang up is


Bastien



From: "David Skyers" <[EMAIL PROTECTED]>
To: 
Subject: [PHP-DB] How to stop the server timing out
Date: Tue, 3 Oct 2006 11:51:30 +0100

Hi,

I have written a php page and every time I run it, it causes the server
to times-out. Is there anything I can do, to get the page to run
completely or speed up how the page works. Please note I do not have any
control over the server.

The page does a select from a table and inserts the data into another
table. However it times-out half way through inserting.

The code is attached.

Thanks,

David


David Skyers
Support Analyst
Management Systems, EISD, UCL
Extension: 41849
Tel: 020 7679 1849
Email: [EMAIL PROTECTED]






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




--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Pozdrawiam
Szymon Fornal
Bild Presse Polska s.c.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
e-mail: [EMAIL PROTECTED]
   GG: 1234713
  ICQ: 208408766
mobile: (+48) 504049222
 work: (+48) 042 6362632 w. 18
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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



RE: [PHP-DB] How to stop the server timing out

2006-10-03 Thread Bastien Koert
You need to just start adding echo statements to the code to see where the 
hang up is


Bastien



From: "David Skyers" <[EMAIL PROTECTED]>
To: 
Subject: [PHP-DB] How to stop the server timing out
Date: Tue, 3 Oct 2006 11:51:30 +0100

Hi,

I have written a php page and every time I run it, it causes the server
to times-out. Is there anything I can do, to get the page to run
completely or speed up how the page works. Please note I do not have any
control over the server.

The page does a select from a table and inserts the data into another
table. However it times-out half way through inserting.

The code is attached.

Thanks,

David


David Skyers
Support Analyst
Management Systems, EISD, UCL
Extension: 41849
Tel: 020 7679 1849
Email: [EMAIL PROTECTED]






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


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



  1   2   3   4   5   6   7   8   >