I have long known that one could fetch results from a mysql table and print it as :
(MySQL C API)
MYSQL_RES *result = mysql_store_result(con);
if (result == NULL)
{
finish_with_error(con);
}
int num_fields = mysql_num_fields(result);
MYSQL_ROW row;
while ((row = mysql_fetch_row(result)))
{
printf("%s ", row[i] ? row[i] : "NULL");
}
Now suppose I have to copy a database into another, can I do the other way round i.e can I somehow use the row variable to insert into the new database.
If I could do this copying a database would be so easy.
By copying a database I mean I have to create a database that is exactly the same as the original one, with all its data and attributes being the same.