ok sorry let me include the code(which I should have done the first time), I have so far and then it should become clear what I am trying to do and the difficults I am having: the function is in a separate file: function findEntryId($tableName,$keyName){ connects to DB $db ="SELECT * FROM '$tableName' WHERE '$keyName' = $selectOption"; $mysql_result = mysql_query($db); $temp = mysql_fetch_array($mysql_result); return $temp; } in another file the call: $row = findEntryId("vendor","vendor_num"); the problem is I want $row to equal $temp after the call but it is not allowing me to return $temp, any ideas? > ---------- > From: Alexander Wagner[SMTP:[EMAIL PROTECTED]] > Sent: Monday, May 21, 2001 4:19 PM > To: Lybarger, Denver J (LYBARDJ8); '[EMAIL PROTECTED]' > Subject: Re: [PHP] mysql and user-defined functions > > Lybarger, Denver J (LYBARDJ8) wrote: > > Is there a way to return the results of a mysql_query or the > > array that is generated after mysql_fetch_array, via a function? > > Note I have tried to do a straight return. > > What was the problem? This should work. Maybe you just got the > mysql_fetch_array() wrong, or the database-connect. > > > Another issue is that all > > of the tables are a different size, therefore a static array size > > would be a big waste of memory. > > PHP doesn't have static array sizes, only associative arrays. > > > Thanks for any help you could lend. > > Sorry, but what you wrote is insufficent to find out where your problem > lies. For me, anyway. > > regards > Wagner > > -- > "Some guy hit my fender, and I told him, 'Be fruitful and multiply,' > but not in those words." > - Woody Allen > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mysql and user-defined functions
Lybarger, Denver J (LYBARDJ8) Tue, 22 May 2001 05:49:15 -0700
- [PHP] mysql and user-defined functions Lybarger, Denver J (LYBARDJ8)
- Re: [PHP] mysql and user-defined functi... Alexander Wagner
- Re: [PHP] mysql and user-defined functi... Lybarger, Denver J (LYBARDJ8)
- Re: [PHP] mysql and user-defined fu... Alexander Wagner