Jump to content

dransiksapoc

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by dransiksapoc

  1. I take that back I found my problem and fixed it. Thanks for all the help guys, I really am starting to get a handle on some of the basics of this stuff, thank you.
  2. [!--quoteo(post=379633:date=Jun 3 2006, 10:05 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 3 2006, 10:05 AM) [snapback]379633[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code]$query = mysql_query('SELECT * FROM `Montster` $metode LIKE '%$search%'"); [/code] That's likely the cause of the problem. Try: [code]$query = mysql_query("SELECT * FROM `Montster` $metode LIKE '%$search%' "); [/code] [/quote] That was the problem, thank you much. I now am getting no record found on my php page, I don't know why as of yet, gonna play around with it a bit, but if anyone has any suggestions why that is I'm more then welcome for the advice
  3. The URL was not correct under the action and actually I do have the Method set as post in my form, but what I'm getting now is: Parse error: parse error, unexpected $ in /home/warriors/public_html/Table/monster.php on line 82 Thing is there is no line 82 actually it ends on 81
  4. I tried searching the forums as well as the internet. Needless to say I could't find a solution. What I'm trying to do is setup a form in html to search multiple columns not at once just single in my php results page. Everytime I submit it I get a 404. The form is setup like this: <form method="post" action="http://warriorsofhonor.org/table/monster.php" target="_blank"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="#000000"> <p align="center"> <select name="metode" size="1"> <option value="Name">Name</option> <option value="Level">Level</option> <option value="Averag HP">Average HP</option> <option value="Damage Type">Damage Type</option> <option value="Class">Class</option> </select> <input type="text" name="search" size="25"> <br> Search database: <input type="submit" value="Go!!" name="Go"></p> </td> </tr> </table> </div> </form> And the subsequent results page is setup like this: <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td><b>Name</b></td> <td><b>Level</b></td> <td><b>Average HP</b></td> <td><b>Damage Type</b></td> <td><b>Resistances</b></td> <td><b>Vulnerabilities</b></td> <td><b>Class</b></td> <td><b>Type</b></td> <td><b>Edition</b></td> </tr> <tr> <td> <?php $hostname = 'localhost'; $username = ''; $password = ''; $dbname = 'warriors_members'; MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable"); @mysql_select_db( "$dbname") or die( "Unable to select database"); ?> <? //error message (not found message)begins $XX = "No Record Found, to search again please close this window"; //query details table begins $metode = $_POST['metode']; $search = $_POST['search']; $query = mysql_query('SELECT * FROM `Montster` $metode LIKE '%$search%'"); while ($row = @mysql_fetch_array($query)) { $variable1=$row["Name"]; $variable2=$row["Level"]; $variable3=$row["Average HP"]; $variable4=$row["Damage Type"]; $variable5=$row["Resistances"]; $variable6=$row["Vulnerabilities"]; $variable7=$row["Class"]; $variable8=$row["Type"]; $variable9=$row["Edition"]; //table layout for results print ("<tr>"); print ("<td>$variable1</td>"); print ("<td>$variable2</td>"); print ("<td>$variable3</td>"); print ("<td>$variable4</td>"); print ("<td>$variable5</td>"); print ("<td>$variable6</td>"); print ("<td>$variable7</td>"); print ("<td>$variable8</td>"); print ("<td>$variable9</td>"); print ("</tr>"); } //below this is the function for no record!! if (!$variable1) { print ("$XX"); } //end ?> </table> </center> Anyway, any suggestions would be helpful.
  5. [!--quoteo(post=379268:date=Jun 2 2006, 01:50 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Jun 2 2006, 01:50 AM) [snapback]379268[/snapback][/div][div class=\'quotemain\'][!--quotec--] $query = mysql_query('SELECT * FROM `Montster` LIMIT 0, 30 '); [/quote] Holy mother, thank you so much. (also kinda feel like an idiot for not seeing that lol)
  6. Ok, so I'm pretty new to php as well as databases so I beg you; keep it simple for me. Anyway, I'm trying to make a results page for a database of mine and I keep getting the no record found script. This is what I have so far: <center> <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td><b>Name</b></td> <td><b>Level</b></td> <td><b>Average HP</b></td> <td><b>Damage Type</b></td> <td><b>Resistances</b></td> <td><b>Vulnerabilities</b></td> <td><b>Class</b></td> <td><b>Type</b></td> <td><b>Edition</b></td> </tr> <tr> <td> <?php $hostname = 'localhost'; $username = 'XXXXX'; $password = 'XXXXX'; $dbname = 'warriors_members'; MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable"); @mysql_select_db( "$dbname") or die( "Unable to select database"); ?> <? //error message (not found message)begins $XX = "No Record Found, to search again please close this window"; //query details table begins $query = mysql_query("$sql = 'SELECT * FROM `Montster` LIMIT 0, 30 '"); while ($row = @mysql_fetch_array($query)) { $variable1=$row["Name"]; $variable2=$row["Level"]; $variable3=$row["Average HP"]; $variable4=$row["Damage Type"]; $variable5=$row["Resistances"]; $variable6=$row["Vulnerabilities"]; $variable7=$row["Class"]; $variable8=$row["Type"]; $variable9=$row["Edition"]; //table layout for results print ("<tr>"); print ("<td>$variable1</td>"); print ("<td>$variable2</td>"); print ("<td>$variable3</td>"); print ("<td>$variable4</td>"); print ("<td>$variable5</td>"); print ("<td>$variable6</td>"); print ("<td>$variable7</td>"); print ("<td>$variable8</td>"); print ("<td>$variable9</td>"); print ("</tr>"); } //below this is the function for no record!! if (!$variable1) { print ("$XX"); } //end ?> </table> </center> I would love some help if you see anything wrong, lol again the help is much appreciated because as I stated earlier: I'm tired of seeing no record found.
×
×
  • 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.