Jump to content

kaimason1

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Everything posted by kaimason1

  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...
  14. *sigh* You kids today.... They were characters in the original Transformers cartoon/toyline of the 1980's. You know... Optimus Prime? Starscream? Megatron? http://www.youtube.com/watch?v=CccbBwyDAdk When I was a kid, the Transformers were more or less my religion, along with Voltron and Robotech. sorry, i didn't know...
  15. 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.
  16. Take a look at http://www.phpfreaks.com/tutorial/basic-pagination/page1. It is a tutorial about this same problem.
  17. it depends... who the *beep* are Sideswipe and Sunstreaker??? ??? ??? For that matter, who is Skywarp?... well, I guess that proves you are a nerd... there's a kid at my school who can name almost every Sonic the Hedgehog character, their gender, their birthday, every nation in the series and their leaders, along with every mentioned citizen. Top that.
  18. Hi. I am a thirteen year old w/ no life who is learning PHP for a project. I did a little BASIC programming in fourth grade and I tried to learn C++ when I was in fifth. Didn't turn out too well. I might start that up again after I'm done with this PHP project... then again, might stay the course. I want to become a physicist at CERN when I grow up, and I am good with photoshoping images.
  19. ok then... :o what the... one of my eyeballs seems to have fallen out...
  20. although i know this is random, isn't that exactly what this board is for? anyway, anyone want to prove just how nerdy they can be? for example, i can give you guys a list of monty python quotes and i can tell you just about anything that has to do with star wars or star trek tng, all you need to do is prompt me.
  21. nice. Edit (Daniel0): Removed excessive use of smileys.
  22. I worship your nerdiness... Tell me how you do that... and i thought i was schizophrenic... go dunk your head, waynewex.
  23. This is a sort of game... the rules are to post the first word that pops into your head after reading the last post. Please don't post without a word. Have fun! To start: PHP
×
×
  • 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.