I am a newbie and want to ask a few simple question about mysql using php. Please correct me if I am wrong.

1) What type of variable would be returned from the function
mysql_list_fields("dbname", "tablename", $link); ??

Can I change it to a string type variable? If so, what function can i use to search this string for a certain phrase/group of letters?

2) I want to be able to pick a field randomly from a table in a mysql database, how can I do this?

3)How can I add some data into my mysql database from php?

Thank You. Hopefully my questions are not to stupid.

    1) A pointer is returned, to be used in conjunction with another command. This function is depreciated though, and you should instead execute a SQL query of SHOW COLUMNS FROM table [LIKE 'name']

    2) Off the top of my head, get the list of fields into an array, then use [man]rand[/man] to select one.

    3) Just perform a [man]mysql_query[/man] on your insert statement

      Write a Reply...