Jump to content

fisher7679

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by fisher7679

  1. I figured it out, didnt catch the -- in the insert code that had to be removed. Thanks for the help earlier.
  2. Ok, not sure why but the echo results are not showing on the page. Here is the form code. Also I changed it to .php, added the include and set the action to post to itself like stated above. <form action="f0rm.php" method="post"> <p align="center" style="margin-bottom: 0"> <b><font size="3">Test</font></b></p> <p align="center" style="margin-bottom: 0"> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> </select> <br /> <br /> </p> <p align="center"> <input class="button" type="submit" name="submit" value="Submit"> </p> </form> <!--?php include 'data.php'; ?--> Could it be an issue with the echo? Here us the php code I am using for tetsting <?php mysql_connect("", "", "") or die(mysql_error()); mysql_select_db("") or die(mysql_error()); $term1 = $_POST['term1']; $term2 = $_POST['term2']; $term3 = $_POST['term3']; $term4 = $_POST['term4']; $term5 = $_POST['term5']; $term6 = $_POST['term6']; $term7 = $_POST['term7']; $term8 = $_POST['term8']; $term9 = $_POST['term9']; $term10 = $_POST['term10']; $sql = ("my sql string here"); $rs_result = mysql_query ($sql); $num_rows = mysql_num_rows($rs_result); $total_rows = mysql_num_rows($data2); $result = ($num_rows/($total_rows)); $percent = round($result*100, 4, PHP_ROUND_HALF_UP); { } echo "$percent%"; ?> Any further help her would be appreciated as I am stumped. Thanks in advance.
  3. The page the form is located on is a html page, it then submits the results to the php page to get the data from the database. I would like the results to appear under the submit button on the html page if able to do so.
  4. Still learning...............So I have now been able to make my dropdown menu pass the results to the php page from the data stored in mysql and show the results with echo on the php page. But I would like those results to be displayed on the same page. How would I start going about this?
  5. Thank you! That worked to fix it and also helps me to understand how to do it again in the future.
  6. To be honest I am sure this is something simple that I am missing or just not understanding. What I am trying to do is use a dropdown menu to make a selection to search a db and display the results. The php portion works fine as I have hard coded the search criteria into it and it displays the results just fine. I can also use a plain text box and type the search string in with it displaying the results as well. Just not sure what I am doing wrong on the dropdown menu form/ Here is the for code I am using. <html> <head> <title>Untitled Document</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> function get() { $('#data').hide(); $.post('data.php', { name: form.name.value }, function (output) { $('#data').html(output).fadeIn(1000); }); } </script> </head> <body bgcolor="#2E64FE"> <p></p> <p></p> <form action=""><select name="genetics"> <option value="Item1">Item1</option> <option value="Item2">Item2</option> <option value="Item3">Item3</option> <option value="Item4">Item4</option> </select><input type="hidden" name="option value" /> <input type="button" value="Search" onclick="get();" /> <div id="data"></div> </form> </body> </html Any help or direction would be great, Thanks in advance!
  7. Thank requinix! Right now it is echoing only the column "owner", how do I get it to echo all the columns for that table entry that I am looking at?
  8. I have some code that returns a single column in a table, but I need to pull all columns........Can some one point me in the right direction to do this? Here is the code I am using to pull the single column $query = "SELECT * FROM `$table_name` WHERE uuid = '$uuid'"; $result = mysqli_query($dbh,$query); if (!$result) { echo 'Could not run query: ' . mysqli_error($dbh); } else { while ($result_list = mysqli_fetch_array($result, MYSQL_ASSOC)) echo ("uuid: ".$result_list["owner"]); } mysqli_close($dbh); Thanks to anyone who can help. EDIT: I should add I assume it is in the .$result_list[] area. I have tried several different things but nothing has worked so far.
  9. Thank you fastsol! I was able to get the data to print out correct and also add a 4th column for additional data. I was also able to input the data to the db with the tags already on it to make it link able like I needed. The last thing I need figure out is a way for the user to be able to sort the data by location or name. Once I get that done I am gonna take some time and read up on CSS as it has been a long time since I had to program a website. I know what it is and what it does, just not how to implement it into a site.
  10. Hello! I have tried multiple different ideas to accomplish the results I am looking for with only minimal luck. My goal is to be able to pull data from the mysql db and place it in 3 cells while having the next line of data echoed and so on. Basically I want to pull 3 tables and place each table in its own cell which I have accomplished. The part I am having issues with and am unable to figure out is: 1. I would like a header on the cells with a name I designate as the cell name (example: "Owner Name", "Location", "URL") 2. I would like to be able to have the Location hyper linked with the url so they can click the location name and go to that page. The url showing in the last cell is just to show the actual url so they know what it is prior to clicking the Location Name. <?php $host = "localhost"; $user = "testuser"; $pass = "test"; $db = "testuser"; $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); mysql_select_db($db) or die ("Unable to select database!"); $query = "SELECT * FROM locations ORDER BY id DESC"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); define('COLS', 4); $col = 0; echo '<table border="2px">'; echo '<tr>'; while ($rows = mysql_fetch_array($result)) { $col++; if ($col == COLS) { $col = 1; echo '</tr><tr>'; } echo '<td>', '<center>', $rows[3],'<br>', '</center>', '</td>'; } echo '</tr>'; echo "</table>"; mysql_free_result($result); mysql_close($connection); ?> Thank you in advance for any help anyone can offer on this!
  11. The data is passing as I can echo it. The issue I am having is in these to lines I suspect. $name= mysql_real_escape_string($_POST['name']); $data = mysql_query ('SELECT * FROM `my_data` WHERE `value` LIKE CONVERT(_utf8 \'%$name%\' USING latin1) COLLATE latin1_swedish_ci'); My issue is I need to be able to use the $name result in the $data string. I however am unable to do this. Is there a way to accomplish this? Thank you in advance for any help you can give.
×
×
  • 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.