[PHP] Re: newbie array question

2003-07-10 Thread Harry Wiens
try this:

$query = select name from names (where age '23'');
$numero= sybase_connect(database , user , password ) or die (Unable
to connect to database server);
$result=sybase_query($query,$numero );
while($temp=sybase_fetch_array($result)){
$names[] = $temp[name];
}

mfg.
harry wiens

Bob pilly [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 Hi All

 Im new to php and are getting a bit confused about the sybase_fetch_array
function (i think that this is the same as mysql_fetch_array?).

 If i have a valid sql query that returns three the records 'john','jack'
and 'mary' and i want to put that into an array where
array[0]-john,array[1]-jack etc how do i do this? Im trying to use
sybase_fetch_array as follows:

 $query = select name from names (where age '23'');
 $numero= sybase_connect(database , user , password )
 or die (Unable to connect to database server);
 $result=sybase_query($query,$numero );
 $names=sybase_fetch_array($result);


 I then try and do something like print $names[0];

 but it doesnt work. Sorry if this is really basic any help would be
greatly appreciated!



 -
 Want to chat instantly with your online friends? Get the FREE
Yahoo!Messenger



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



[PHP] Re: newbie array question

2002-08-13 Thread S.P. Telgenhof Oude Koehorst

Hi Alexander,

Have a look at the 'explode'-function
(http://www.php.net/manual/en/function.explode.php). That should do the
trick.

Success!

Sacha Telgenhof

Alexander Ross [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 If I have a string variable that is already of the form
 ('item','item2','item3')   [including the parens and quotes in the
string],
 is there an easy way to change that variable into an array??
 Array($var) doesn't work. Thanks





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




[PHP] Re: newbie array question

2002-08-13 Thread S.P. Telgenhof Oude Koehorst

Ignore my first reply. I didn't read the question properly.

Sorry.

Greetz,
Sacha Telgenhof

Alexander Ross [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 If I have a string variable that is already of the form
 ('item','item2','item3')   [including the parens and quotes in the
string],
 is there an easy way to change that variable into an array??
 Array($var) doesn't work. Thanks





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