hi
when i try to run this within a function:
$Result = mysql_fetch_field($dbname, $tablename);
$num = mysql_num_fields ($Result);
i get the following errors in my page:
Warning: mysql_list_fields(): Unable to save MySQL query result
and
Warning: mysql_num_fields(): supplied arguement is not a valid MySQL result resource
Can anyone help???!
mysql_list_fields() and mysql_num_fields() error...
Moderator: General Moderators
-
struggling_student
- Forum Newbie
- Posts: 15
- Joined: Mon Feb 23, 2004 3:51 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
your using that int he wrong way anyways. First you need to connect to the database, then select a database. then query an SQL statement then you can call mysql_fetch_feilds after getting teh result, and you would use it like:
http://php.ru.ac.za/manual/en/function. ... -field.php
Code: Select all
$result = mysql_query($SQL);
$f = mysql_fetch_field($result);