I am writing a database front end interface to MySQL. My web host provides PHP and MySQL support, but I can only access it through web pages, no client.
I am trying to write a line to ADD INDEX to an existing column in a table. The code I am using is:
if(!($result = mysql_query("ALTER TABLE $select ADD INDEX $field1"))) {
printf("<br>Error in adding index to column %s.<br>\n", $field1);
exit();
}
where $select is the name of the table and $field1 is the name of the column to be indexed. The database opens successfully, but then I receive an error that the index was not added. Anyone have a clue? I am sure I'm just not writing the query correctly.
Thanks in advance.
Jim