Jump to content

NovaArgon

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

About NovaArgon

  • Birthday 12/12/1982

Contact Methods

  • Website URL
    http://www.tarantuladatabase.com

Profile Information

  • Gender
    Male
  • Location
    South Carolina

NovaArgon's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello I'm trying to do this. http://phpbb3.smika.net/kb/kb_show.php?id=3 I have the database setup I just need some help translating that link into English and getting an example of what it would look like when I put it into my sql area in phpmyadmin. Here I just need an example I can copy and edit the details. Thanks so much for helping me out with this!!!!
  2. I am having trouble getting this page to validate. Would any of you mind taking a look at it and giving me some very very basic advice? I am very new to php code so i'm easily confused lol. I have just been pasting my code into here http://validator.w3.org/#validate_by_input Alot of the errors look like they are from the php tags and the body and html tags are in the footer so thats why they are showing up. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Tarantula Database Search Results</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="Here you will find everything you ever wanted to know about Tarantulas. Simply fill out the search form and begin seaching our estensive tarantula database." /> <meta name="keywords" content="Tarantula, Tarantula Database, Tarantula Search, Tarantula Forum" /> <meta name="robots" content="all" /> <meta name="author" content="" /> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" /> </head> <body> <div id="container"> <?php include('../../include/header.php'); include('connect.php'); ?> <div id="content"> <h3>Tarantula Database Search Results!</h3> <p> </p> <?php if(empty($_POST['habitat']) && empty($_POST['humidity']) && empty($_POST['speed']) && empty($_POST['size']) && empty($_POST['location']) && empty($_POST['aggression'])){ echo "You did not tell us what to search for!<br><br><br>"; }else{// if there is something to search with.... if(isset($_POST['habitat'])){ $habitat = mysql_real_escape_string(trim($_POST['habitat'])); } if(isset($_POST['humidity'])){ $humidity = mysql_real_escape_string(trim($_POST['humidity'])); } if(isset($_POST['speed'])){ $speed = mysql_real_escape_string(trim($_POST['speed'])); } if(isset($_POST['size'])){ $size = mysql_real_escape_string(trim($_POST['size'])); } if(isset($_POST['location'])){ $location = mysql_real_escape_string(trim($_POST['location'])); } if(isset($_POST['aggression'])){ $aggression = mysql_real_escape_string(trim($_POST['aggression'])); } $where = ''; if(isset($habitat)) { $where? $where .= " AND habitat = '$habitat' " : $where = " habitat = '$habitat' "; }; if(isset($humidity)) { $where? $where .= " AND humidity = '$humidity' " : $where = " humidity = 'humidity' "; } if(isset($speed)) { $where? $where .= " AND speed = '$speed' " : $where = " speed = '$speed' "; } if(isset($size)) { $where? $where .= " AND size = '$size' " : $where = " size= '$size' "; } if(isset($location)) { $where? $where .= " AND location = '$location' " : $where = " location = '$location' "; } if(isset($aggression)) { $where? $where .= " AND aggression = '$aggression' " : $where = " aggression = '$aggression' "; } $result = mysql_query("SELECT * FROM `common_traits` WHERE $where AND `approved`='0'") or die(mysql_error()); $count = mysql_num_rows($result); if($count == 0){ echo "There were no records found in the database with the traits you wanted.<br>"; echo "You may also <a href='submit.php'>submit a tarantula to our database</a>"; echo " if you know of the tarantula you are searching for.<br>"; echo "You searched our records with the following requirements<br>$where"; }else{ echo "You searched our records with the following requirements<br>$where"; echo "<br>There is $count record(s) found with those requirements" ; } function bold($handle, $post, $data){// function to bold the searched terms if(!empty($data)){// if something was found in the database if($post == $data){// if the searched term (post) is the same as the column of data in databse, highlight it echo "<b>"; echo $handle; echo ": "; echo $data; echo "</b>"; }else{// show as regular echo $handle; echo ": "; echo $data; } }else{// if he databse entry was emtpy echo $handle; echo ": "; echo "<i>empty</i>"; } echo "<br>"; } echo "<table><tr>"; while($row = mysql_fetch_array($result)){ echo "<br><br><br>"; bold('Genus', $genus, $row['genus']); bold('Species', $empty, $row['species']); bold('Habitat', $habitat, $row['habitat']); bold('Size', $size, $row['size']); bold('Speed', $speed, $row['speed']); bold('Location', $location, $row['location']); bold('Humidity', $humidity, $row['humidity']); bold('Aggression', $aggression, $row['aggression']); } echo "</tr></table>"; }// end of else (located on line 28) ?> <p> </p> <h2>Volunteer Now!</h2> <p> </p> <p>Tarantula Database is currently looking for volunteers to help with our construction process. If you have any skills in PHP, MYSQL, or general web design please <a href="contact.html">contact us</a> for more information.</p> </div> </div> <? include("../../include/footer.php"); ?>
  3. SWEET I got it now it worked thank you guys so much for all the help !!!! Man you guys rock!
  4. no thats the table prefix I dont know if I need it. I just alwas had to use it when connecting to the database with a forum. <? /*--------- DATABASE CONNECTION INFO---------*/ $hostname="localhost"; $mysql_login="e0120590_tester"; $mysql_password="**Hidden**"; $database="e0120590_tarantuladatabase"; // connect to the database server if (!($db = mysql_pconnect($hostname, $mysql_login , $mysql_password))){ die("Can't connect to database server."); }else{ // select a database if (!(mysql_select_db("$database",$db))){ die("Can't connect to database."); } } ?>
  5. I'm sorry I thought I was using your code ??? I must have got it mixed up when I was trying to put it into dreamweaver. Let me look at my code again and see where I missed it.
  6. How long should it take to show up in my phpmyadmin? this is exactly what I posted <?php include("connect.php"); $genus = array ( 'Aphonopelma', 'Augacephalus', 'Avicularia', 'Batesiella', 'Bonnetina', 'Brachionopus', 'Brachypelma', 'Cardiopelma', 'Catumiri', 'Ceratogyrus', 'Chaetopelma', 'Chilobrachys', 'Chromatopelma', 'Citharacanthus', 'Citharischius', 'Citharognathus', 'Clavopelma', 'Coremiocnemis', 'Crassicrus', 'Cratorrhagus', 'Cyclosternum', 'Cyriocosmus', 'Cyriopagopus', 'Cyrtopholis', 'Davus', 'Encyocratella', 'Encyocrates', 'Ephebopus', 'Euathlus', 'Eucratoscelus', 'Eumenophorus', 'Eupalaestrus', 'Euphrictus', 'Grammostola', 'Hapalopus', 'Hapalotremus', 'Haploclastus', 'Haplocosmia', 'Haplopelma', 'Harpactira', 'Harpactirella', 'Hemiercus', 'Hemirrhagus', 'Heteroscodra', 'Heterothele', 'Holothele', 'Homoeomma', 'Hysterocrates', 'Idiothele', 'Iracema', 'Iridopelma', 'Ischnocolus', 'Lampropelma', 'Lasiodora', 'Lasiodorides', 'Loxomphalia', 'Loxoptygus', 'Lyrognathus', 'Mascaraneus', 'Megaphobema', 'Melloina', 'Melloleitaoina', 'Metriopelma', 'Monocentropus', 'Myostola', 'Neostenotarsus', 'Nesiergus', 'Nesipelma', 'Nhandu', 'Oligoxystre', 'Ornithoctonus', 'Orphnaecus', 'Ozopactus', 'Pachistopelma', 'Pamphobeteus', 'Paraphysa', 'Phlogiellus', 'Phoneyusa', 'Phormictopus', 'Phormingochilus', 'Plesiopelma', 'Plesiophrictus', 'Poecilotheria', 'Proshapalopus', 'Psalmopoeus', 'Pseudhapalopus', 'Pseudoligoxystre', 'Pterinochilus', 'Reversopelma', 'Schismatothele', 'Schizopelma', 'Selenobrachys', 'Selenocosmia', 'Selenogyrus', 'Selenotholus', 'Selenotypus', 'Sericopelma', 'Sickius', 'Sphaerobothria', 'Stichoplastoris', 'Stromatopelma', 'Tapinauchenius', 'Theraphosa', 'Thrigmopoeus', 'Thrixopelma', 'Tmesiphantes', 'Trichognathella', 'Vitalius', 'Xenesthis', 'Yamia', ); // $sql = "INSERT INTO tablename (genus) VALUES ('".$genus[$i]."')"; //then make you a while loop that will loop through your Insert into query code 110 times -- Edit lol? /* while($i<=110) { mysql_query($sql,$con); $i++; }*/ for ($x=0;$x<count($genus);$x++) { $sql = "INSERT INTO common_traits(genus) VALUES ('".$genus[$x]."')"; echo "$sql <br>"; //mysql_query($sql); // Uncomment when your ready for the real deal } ?> I just get this message on the php page It repeats over and over for each of the genus Could I not be connecting to the database?
  7. ok just like this <body> <?php include("connect.php"); $genus = array ( 'Aphonopelma', 'Augacephalus', 'Avicularia', 'Batesiella', 'Bonnetina', 'Brachionopus', 'Brachypelma', 'Cardiopelma', 'Catumiri', 'Cerato*****', 'Chaetopelma', 'Chilobrachys', 'Chromatopelma', 'Citharacanthus', 'Citharischius', 'Citharognathus', 'Clavopelma', 'Coremiocnemis', 'Crassicrus', 'Cratorrhagus', 'Cyclosternum', 'Cyriocosmus', 'Cyriopagopus', 'Cyrtopholis', 'Davus', 'Encyocratella', 'Encyocrates', 'Ephebopus', 'Euathlus', 'Eucratoscelus', 'Eumenophorus', 'Eupalaestrus', 'Euphrictus', 'Grammostola', 'Hapalopus', 'Hapalotremus', 'Haploclastus', 'Haplocosmia', 'Haplopelma', 'Harpactira', 'Harpactirella', 'Hemiercus', 'Hemirrhagus', 'Heteroscodra', 'Heterothele', 'Holothele', 'Homoeomma', 'Hysterocrates', 'Idiothele', 'Iracema', 'Iridopelma', 'Ischnocolus', 'Lampropelma', 'Lasiodora', 'Lasiodorides', 'Loxomphalia', 'Loxoptygus', 'Lyrognathus', 'Mascaraneus', 'Megaphobema', 'Melloina', 'Melloleitaoina', 'Metriopelma', 'Monocentropus', 'Myostola', 'Neostenotarsus', 'Nesiergus', 'Nesipelma', 'Nhandu', 'Oligoxystre', 'Ornithoctonus', 'Orphnaecus', 'Ozopactus', 'Pachistopelma', 'Pamphobeteus', 'Paraphysa', 'Phlogiellus', 'Phoneyusa', 'Phormictopus', 'Phormingochilus', 'Plesiopelma', 'Plesiophrictus', 'Poecilotheria', 'Proshapalopus', 'Psalmopoeus', 'Pseudhapalopus', 'Pseudoligoxystre', 'Pterinochilus', 'Reversopelma', 'Schismatothele', 'Schizopelma', 'Selenobrachys', 'Selenocosmia', 'Seleno*****', 'Selenotholus', 'Selenotypus', 'Sericopelma', 'Sickius', 'Sphaerobothria', 'Stichoplastoris', 'Stromatopelma', 'Tapinauchenius', 'Theraphosa', 'Thrigmopoeus', 'Thrixopelma', 'Tmesiphantes', 'Trichognathella', 'Vitalius', 'Xenesthis', 'Yamia', ); // $sql = "INSERT INTO tablename (genus) VALUES ('".$genus[$i]."')"; //then make you a while loop that will loop through your Insert into query code 110 times -- Edit lol? /* while($i<=110) { mysql_query($sql,$con); $i++; }*/ for ($x=0;$x<count($genus);$x++) { $sql = "INSERT INTO common_traits(genus) VALUES ('".$genus[$x]."')"; echo "$sql <br>"; //mysql_query($sql); // Uncomment when your ready for the real deal } ?>
  8. Thanks so much how does this look? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>upload</title> </head> <body> $genus = array ( 'Acanthopelma', 'Acanthoscurria', 'Annandaliella', 'Anoploscelus', 'Aphonopelma', 'Augacephalus', 'Avicularia', 'Batesiella', 'Bonnetina', 'Brachionopus', 'Brachypelma', 'Cardiopelma', 'Catumiri', 'Ceratogyrus', 'Chaetopelma', 'Chilobrachys', 'Chromatopelma', 'Citharacanthus', 'Citharischius', 'Citharognathus', 'Clavopelma', 'Coremiocnemis', 'Crassicrus', 'Cratorrhagus', 'Cyclosternum', 'Cyriocosmus', 'Cyriopagopus', 'Cyrtopholis', 'Davus', 'Encyocratella', 'Encyocrates', 'Ephebopus', 'Euathlus', 'Eucratoscelus', 'Eumenophorus', 'Eupalaestrus', 'Euphrictus', 'Grammostola', 'Hapalopus', 'Hapalotremus', 'Haploclastus', 'Haplocosmia', 'Haplopelma', 'Harpactira', 'Harpactirella', 'Hemiercus', 'Hemirrhagus', 'Heteroscodra', 'Heterothele', 'Holothele', 'Homoeomma', 'Hysterocrates', 'Idiothele', 'Iracema', 'Iridopelma', 'Ischnocolus', 'Lampropelma', 'Lasiodora', 'Lasiodorides', 'Loxomphalia', 'Loxoptygus', 'Lyrognathus', 'Mascaraneus', 'Megaphobema', 'Melloina', 'Melloleitaoina', 'Metriopelma', 'Monocentropus', 'Myostola', 'Neostenotarsus', 'Nesiergus', 'Nesipelma', 'Nhandu', 'Oligoxystre', 'Ornithoctonus', 'Orphnaecus', 'Ozopactus', 'Pachistopelma', 'Pamphobeteus', 'Paraphysa', 'Phlogiellus', 'Phoneyusa', 'Phormictopus', 'Phormingochilus', 'Plesiopelma', 'Plesiophrictus', 'Poecilotheria', 'Proshapalopus', 'Psalmopoeus', 'Pseudhapalopus', 'Pseudoligoxystre', 'Pterinochilus', 'Reversopelma', 'Schismatothele', 'Schizopelma', 'Selenobrachys', 'Selenocosmia', 'Selenogyrus', 'Selenotholus', 'Selenotypus', 'Sericopelma', 'Sickius', 'Sphaerobothria', 'Stichoplastoris', 'Stromatopelma', 'Tapinauchenius', 'Theraphosa', 'Thrigmopoeus', 'Thrixopelma', 'Tmesiphantes', 'Trichognathella', 'Vitalius', 'Xenesthis', 'Yamia', ); //then create a SQL statement variable $i=0; $sql = "INSERT INTO tablename (genus) VALUES ($genus[$i])"; //then make you a while loop that will loop through your Insert into query code 114 times while($i<=114) { mysql_query($sql,$con); $i++; } </body> </html>
  9. Ok guys no more error messages! You try it out here I think its connecting with the database even though its not valid code but I'll work on that So this is my new code in echo.php <div class="c1"> <table cellspacing="20"> <tr> <th>Habitat</th> <th>Humidity</th> <th>Speed</th> <th>Size</th> <th>Location</th> <th>Aggression</th> </tr> <? include("connect.php"); // now you are connected and can query the database $request = mysql_query("SELECT * FROM common_traits WHERE habitat = \"".$_REQUEST['habitat']."\" AND humidity = \"".$_REQUEST['humidity']."\" AND speed = \"".$_REQUEST['speed']."\" AND size = \"".$_REQUEST['size']."\" AND location = \"".$_REQUEST['location']."\", AND aggression = \"".$_REQUEST['aggression']."\""); // loop through the results with mysql_fetch_array() if ( @mysql_num_rows($row) > 0 ) { while($row = mysql_fetch_array($result)){ echo " <tr> <td>".$row['habitat']."</td> <td>".$row['humidity']."</td> <td>".$row['speed']."</td> <td>".$row['size']."</td> <td>".$row['location']."</td> <td>".$row['aggression']."</td> </tr> "; } } else { echo "<tr><td colspan = 6></td></tr>"; } // don't forget to close the mysql connection mysql_close(); ?> </table> <a href="http://www.tarantuladatabase.com/assets/pages/search.html"><input name="Back" type="button" value="Back" /></a></div> </div> Please correct me if i'm wrong but i think my next step in the project is to create a form that will submit data to my database so that I have something to search? I need to add a all of the database field values for genus there are a lot for them. I think about 113 give or take in this pic I have 4 of them added already. I know there is a way to past them into my sql and submit them all at one time but I don't know the format. What I would like to do is creat the file in a .txt file and then copy and past it to the database once its all compiled. Is there any way you can give me any example of the code I would need to submit that to the database? I have also added a species field that will be typed in by my users when they submit a new species into the database. but before I start doing all this I just wanted to check and make sure it was necessary. Just to explain how the submission form will work you select a genus from the drop down then type in the species name in the text box. Click one of each of the bullet points and click the tarantula submission button. This is the submission form I want that to create a new tarantula in my database under the selected genus. Is this adding up? Thanks so much for all the help and advice.
  10. Thanks so much for all the advice It looks like that was the problem. I have a new error message so I think I am connected fine and now the problems are just in the echo.php file. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/e0120590/public_html/tarantuladatabase.com/assets/php/echo.php on line 43 Here we go lol
  11. This is my first time working with php and databases and I would like some advice trying to connect them. This is my database table fields http://www.tarantuladatabase.com/tf.jpg This is my field values http://www.tarantuladatabase.com/fv.jpg I am using two php files one of them is called connect.php and it only has the information to connect to my database. The other files is called echo.php. The form is at http://www.tarantuladatabase.com/assets/pages/search.html When I try and connect I am getting this error message Warning: include(includes/connect.php) [function.include]: failed to open stream: No such file or directory in /home/e0120590/public_html/tarantuladatabase.com/assets/php/echo.php on line 38 Warning: include() [function.include]: Failed opening 'includes/connect.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/e0120590/public_html/tarantuladatabase.com/assets/php/echo.php on line 38 Warning: mysql_query() [function.mysql-query]: Access denied for user 'e0120590'@'localhost' (using password: NO) in /home/e0120590/public_html/tarantuladatabase.com/assets/php/echo.php on line 40 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/e0120590/public_html/tarantuladatabase.com/assets/php/echo.php on line 40 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/e0120590/public_html/tarantuladatabase.com/assets/php/echo.php on line 43 Warning: mysql_close(): no MySQL-Link resource supplied in /home/e0120590/public_html/tarantuladatabase.com/assets/php/echo.php on line 48 I am kinda stuck right here so any advice would be greatly appreciated. [attachment deleted by admin]
  12. never mind I fixed the id thing and got rid of the search all and none values. http://www.tarantuladatabase.com/gotit.JPG now i guess i'll try and connect it to the database *Gulp* unless you guys have any advice?
  13. I think i got the hang of how to create the table... I think This is my table http://www.tarantuladatabase.com/table.JPG and these are the values http://www.tarantuladatabase.com/value.JPG I couldn't figure out how to leave a field value black so I just put None in as a place holder. How does that look? Any advice would be great
  14. I'm still not sure if this is posted in the right place but http://www.tarantuladatabase.com/assets/pages/test.html This is kinda what I have been playing around with for php If this is working I can see how it works a little. I haven't been able to get connected to the database I did find out that to make a table I go into my cpanel then into phpmyadmin. I made a table with 1 feild but I don't understand what format I need to use. Will i have 1 table for each spider or will i have 1 table called Tarantula with 1 field called Housing and so one like this. Table called Tarantula >Housing >>>>>>>>Arboreal >>>>>>>>Terrestrial >>>>>>>>Fossorial >Location >>>>>>>>New World >>>>>>>>Old World >Speed >>>>>>>>Slow >>>>>>>>Medium >>>>>>>>Fast Is this right at all? I am confused about the things that I dont know like genes species and color.
  15. This is a little background on what my goal is. I have been trying deferent search engines from here for my Tarantula website and I haven't really come up with anything for the search function it just needs to allow users search by all or any of these options. 1. Scientific Names = genus + species----------Will be added over time 2. Genus = 100+ different tarantulas-----------Can be added upfront but may need to change or add to over time 3. Species = 800+ different species------------Will be added over time 4. color = The most common colors-------------Will be added over time 5. Gender = Male, Female----------------------Fixed 6. Humidity = Low 50% to 60%, Medium 60% to 70%, High 70% to 85%-------Fixed 7. Speed = Slow, Medium, Fast-----------------Fixed 8. Temperature = Cool 50°F to 80°F, Warm 60°F to 90°F, Hot 75°F to 90°F----Fixed 9. Max Size = 1" to 3", 4" to 6", 7" to 8, 9"+-----Fixed 10. Location = New World, Old World------------Fixed 11. Housing = Arboreal, Terrestrial, Fossorial-----Fixed There are 800+ different types of Tarantulas and 99% of the time, you decided you want a big one or a small one or a blue one or a extra harry one before you find out what Tarantulas actually have those traits. I would like my site to be a place where you can search for blue and find all the Tarantulas that are tagged as blue. You could mix and match and search to find all the blue Tarantulas that are Old World and so on. I also need a system that will allow users to submit Tarantulas to my website using their scientific names along with any other information or pictures they have. There also must be a way for me/admin to approve/deny/edit all the submission before they are posted into the site or made search able. So there will need to be some type of admin login panel that will allow me/admin to be the only ones able to approve/deny/edit the submission. There must also be some way to upload images and data about the Tarantulas that are already existing in the site. I also need to be able to have a good looking results page. Well you've got to start some where right? Please forgive me for the following vague questions but being a beginner its really be a challenge to explain everything I need the search function to do. I would really appreciate it if you guys would be so kind as to help me figure out what sets of code/database or program will allow me to accomplish this? My most important question is how a beginner should go about starting a project like this? I was advised to check out regex, php, mysql, and ASP (I think it only works on windows server and mine is on a Linux) ??? This is a link to my site. The only thing I care to keep is the design the form's not connected to anything and for all I know I'll never need them but I made them just to give myself an idea of what I thought it would look like. http://www.tarantuladatabase.com/assets/pages/search.html Thank you all so much for trying to get me started on the right path.
×
×
  • 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.