Inserting data via serach
Posted: Sat May 21, 2005 5:00 am
Sorry for the repost...i didnt submit the first topic correctly, so it got ignored...ok, total newbie....ive been going through a book and trying to alter for my own needs, but i just cant get it to work....could anyone help
I understand that i need to create a dummy table prior to retrieving actual data in result page. What i have so far the the following, but i need help as i think i made a total mess of it.I just want to retreive, via a search informtion from one database table.
The first bit to ive tried to insert into a empty table, but i think that this is totally wrong!
The next 2 section are as:
I hope someone is able to help and point me in the right direction. Many thanks in advance
I understand that i need to create a dummy table prior to retrieving actual data in result page. What i have so far the the following, but i need help as i think i made a total mess of it.I just want to retreive, via a search informtion from one database table.
The first bit to ive tried to insert into a empty table, but i think that this is totally wrong!
Code: Select all
<?php
mysql_select_db($database_tapfinalconnection, $tapfinalconnection);
$query_LibraryLookup = "INSERT INTO librarylookup SELECT library_1.BookID, library_1.BookTitle, library_1.Author, library_1.BookISDM, library_1.AuthorInitail, library_1.Comment, library_1.SessionCube FROM library, library library_1, library";
mysql_query($query_Librarylookup,$tapfinalconnection);
?>Code: Select all
<?php
$WhereParam_Library = "Where BookID <>0";
if (isset($WhereParam)) {
$WhereParam_Library = (get_magic_quotes_gpc()) ? $WhereParam : addslashes($WhereParam);
}
mysql_select_db($database_tapfinalconnection, $tapfinalconnection);
$query_Library = sprintf("SELECT * FROM LibraryLookup %s", $WhereParam_Library);
$Library = mysql_query($query_Library, $tapfinalconnection) or die(mysql_error());
$row_Library = mysql_fetch_assoc($Library);
$totalRows_Library = mysql_num_rows($Library);
?>
<?php
$query_LibraryLookup = "DELETE FROM librarylookup";
mysql_query($query_LibraryLookup,$tapfinalconnection);
?>