Jump to content

kaimason1

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

About kaimason1

  • Birthday 02/16/1995

Profile Information

  • Gender
    Male
  • Location
    USA... really wish it would be UK though...

kaimason1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Unknown column 'Book' in 'where clause' Now I'm getting this error... help? EDIT:: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>My Search</TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <BODY> <FORM METHOD="get" action="search.php"> <P>Please enter your search words here and specify the type of data you input: <INPUT type="text" name="search" size=30 maxlength=70> <SELECT name="type" size="1"> <OPTION value="Title">Title</OPTION> <OPTION value="Author">Author</OPTION> <OPTION value="Genre">Genre</OPTION> <OPTION value="Page_Count">Page Count</OPTION> <OPTION value="Reading_Level">Reading Level</OPTION> <OPTION value="ISBN">ISBN</OPTION> </SELECT> </P> <INPUT type="submit" name="submit" value="Submit"> </FORM> </BODY> </HTML> <?php if(isset($_GET['submit']) && $_GET['submit'] == "Submit") { //Connect to database// include("usernamepassworddatabase.php"); mysql_connect(localhost,$username,$password)or die("I couldnt connect, sir. By the way, am I being paid for acting like a personal butler?"); mysql_select_db($database)or die("The database you are trying to access is currently unavailable. Curious..."); //Retrieve variables from HTML form $search=trim(mysql_real_escape_string($_GET['search'])); $type=trim(mysql_real_escape_string($_GET['type'])); //Create MySQL query// if($search == "") { die("Please enter a search."); } else if($type == "Title") { $query="SELECT * FROM TEST1_contacts WHERE 'Book' LIKE '%$search%'"; } else if($type == "Author") { $query="SELECT * FROM TEST1_contacts WHERE 'Author' LIKE '%$search%'"; } else if($type == "Genre") { $query="SELECT * FROM TEST1_contacts WHERE 'Genre' LIKE '%$search%'"; } else if($type == "Page_Count") { $query="SELECT * FROM TEST1_contacts WHERE 'Page_Count' LIKE '%$search%'"; } else if($type == "Reading_Level") { $query="SELECT * FROM TEST1_contacts WHERE 'Reading_Level' LIKE '%$search%'"; } else if($type == "ISBN") { $query="SELECT * FROM TEST1_contacts WHERE 'ISBN' LIKE '%$search%'"; } else{ die("Congratulations -- you achieved the impossible rating of hacker. How else did I receive an inaccurate data type, hmm?"); } //Search Results// $result=mysql_query($query) or die (mysql_error()); $num=mysql_num_rows($result); if($num == 0) { die("There seems to be no records matching your search. Interesting..."); } else{ $i=0; while($i<$num){ $book=mysql_result($result,$i,"Book"); $author=mysql_result($result,$i,"Author"); $genre=mysql_result($result,$i,"Genre"); $page_count=mysql_result($result,$i,"Page_Count"); $reading_level=mysql_result($result,$i,"Reading_Level"); $ISBN=mysql_result($result,$i,"ISBN"); echo("<b>$book</b> by $author.<br>$genre.<br>$page_count pages.<br>$reading_level reading level.<br>ISBN:$ISBN<br><hr><br>"); ++$i; } } } php?>
  2. Thank you! I feel dumb... it worked!
  3. Warning: main(usernamepassworddatabasephp) [function.main]: failed to open stream: No such file or directory in /home/mekam2/public_html/kai/database/post_books.php on line 56 Warning: main() [function.include]: Failed opening 'usernamepassworddatabasephp' for inclusion (include_path='.:/usr/lib/php') in /home/mekam2/public_html/kai/database/post_books.php on line 56 I am getting this message from my script. Here is line 56: include(usernamepassworddatabase.php);
  4. anyone want to vote? again? :-\
  5. Ok, I think I'll change to that. If anyone has a problem, let me know. EDIT::: I also reset the poll in case my messed descriptions confused people...
  6. I would like to see another tutorial... am I asking for too much?... any way, I can't seem to find anything intelligible about login scripts. I just can't find one. Help???
  7. i have at least twice. one, i can't remember quite what happened for some odd reason... but the other i called a kid a moron because his last name was moran.... bad decisions, bad decisions... ??? what were we talking about?
  8. you know what... i agree with you there. except for when they get me punched in the face. then, they can hurt.. a little
  9. i was joking, being sarcastic, i don't know... I just wonder too...
  10. I agree. impressive. I thought the most impressive was the desktop wallpaper one... what programming languages did you use, chris, or was it just PHP?
  11. Also, it only shows a single page when i go to it. after that, i can't see much else. and when did the db server go down?
  12. I have no clue. I think he doesn't understand where the line is drawn between la-la land and reality. Sorry the poll isn't put together right. any suggestions about how to realign it? and by the way, corbin, I read that like he was serious. and understood it. weird. I understood him too, just thought he was joking at parts ;p. As for the lala land guy, he's probably just another person who wants attention. that la la land guy doesn't even pay attention in class, so i dont think he can concentrate on attention grabbing. ill ask him though . I still would like a better organization of the poll, though.
  13. O.k... someone tell me what's up with the get to know your fellow coder board...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.