Jump to content

osyrys14

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by osyrys14

  1. Now I am back to getting nothing when I put something in the search box, and returning all rows when nothing is entered. I do appreciate the help!
  2. I'm using the following code to query and echo data from a search, and I'm trying to figure out how to use more of the fields in the output, including adding one of the columns together for a total, any help would be greatly appreciated. $query_for_result=mysql_query("SELECT * FROM $db_tb_name WHERE $db_tb_atr_name like '%".$query."%'"); echo "<h2>Search Results</h2><ol>"; while($data_fetch=mysql_fetch_array($query_for_result)) { echo "<li>"; echo substr($data_fetch[$db_tb_atr_name], 0,160); echo "</li><hr/>"; } echo "</ol>";
  3. one more quick question.... This code is where it's putting the information out, echo "<li>"; echo substr($data_fetch[$db_tb_atr_name], 0,160); echo "</li><hr/>"; How easy is it to add more of the data (since I'm pulling * from database), to the output, and one of them is a number field that we need to add together for the sum of all rows. I really appreciate your help!
  4. I knew I was missing something simple! That fixed it, thank you so much for the help!!
  5. Hey everyone, I found a simple search online, and it's acting strange. If I put anything in the search field, it returns nothing, if I leave it blank, it returns every field in the database. Code is below if anyone can check... I've been staring at it for over 2 hours trying to find out why... Thanks in advance. <!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> <title>Search</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <form method="get" action=""> <label>Search For: </label><input type="text" name="query" /> <input type="submit" name="submit" value="Start Search" /> <input type="reset" value="Reset" </form> <?php if(isset($_GET['submit'])){ $db_host="localhost"; $db_username="myusername"; $db_password="mypass"; $db_name="nydb"; $db_tb_name="mytable"; $db_tb_atr_name="column"; mysql_connect("$db_host","$db_username","$db_password"); mysql_select_db("$db_name"); $query=mysql_real_escape_string($_GET['query']); $query_for_result=mysql_query("SELECT * FROM $db_tb_name WHERE '8' like '%".$query."%'"); echo "<h2>Search Results</h2><ol>"; while($data_fetch=mysql_fetch_array($query_for_result)) { echo "<li>"; echo substr($data_fetch[$db_tb_atr_name], 0,160); echo "</li><hr/>"; } echo "</ol>"; mysql_close(); } ?> </body> </html>
  6. The only thing that shows up different is this message.... Notice: Use of undefined constant formid - assumed 'formid' in /home/acinquemani/public_html/forms/updatecontact.php on line 24 And line 24 is just echoing the variable to make sure that is flowing to the page.... No other messages or errors. Osyrys
  7. Simple statement, but it's not functioning... Just a simple update query, only I get NO error, and NO update... Here's the code... mysql_query("UPDATE contacts SET fname = '$_POST[formName]' WHERE ID = '$rec'"); $rec used to be $_POST[formid] which is the ID of the entry in the database... The variables passed have been verified as accurate, but still no error, and no update... My eyes hurt from staring at this for this long, any sets of eyes see something I don't? (p.s., I'm not a newbie in this by any means, mostly why this is confusing me so much... ) Thanks in advance for any help! Osyrys
  8. Can anyone take a quick look at this and tell me what I'm missing... I've looked at it so much I'm lost. (i'm not new, just stared too long and can't get my eyes to focus anymore on what I'm missing. <?php $varname = $_POST['formname']; $varaddress = $_POST['formaddress']; $varemail = $_POST['formemail']; $varphone = $_POST['formphone']; $varbustype = $_POST['formtype']; $varmethod = $_POST['formmethod']; $db = mysql_connect("localhost","private","private"); if(!$db) die("Error connecting to MySQL database AGAIN..."); mysql_select_db("table" ,$db); $sql = "INSERT INTO mailing_list ( listname, listaddress, listemail, listphone, listmethod ) VALUES ( '$varname', '$varaddress', '$varemail', '$varphone', '$varbustype', '$varmethod' )" ; mysql_query($sql); ?> The page processes properly without error, but nothing shows in the database... Thanks in advance to any help. Osyrys
  9. My apologies, I read that as how to select and exclude the comments column all together.
  10. Is anyone using this and having random emails not come through? I have a client using this, and when someone fills out the form, it saves the files right, writes to the db right, but once in a while, it won't send the email but the files and db still write fine. Any thoughts? I've tested this every way till sunday, file size, random quotes in the form fields, only get random emails not delivered... (with no returned undeliverable I may add, they just POOF gone and never show...) Anyway, thanks all! Osyrys
  11. You could try selecting only the rows you want instead of selecting * from the table... That's one way.
  12. Freakin' really.... Thanks guys, I couldn't sleep till I figured it out... One stupid line fixed it all, I owe you a beer next time you're in Chicagoland... (we need a "feeling stupid" smiley LOL)
  13. Yes, I did read it, and like I said before, I'm not a newbie, just been looking at this for close to 24 hours straight and know I'm missing something and needed another set of eyes... I know I'm new on this forum, and I appreciate the replies... Maybe some sleep is on order on my part and reload all the messages and files to see what I'm missing... Osyrys
  14. From original post.... $title = $row["lname"]; $title2 = $row["fname"]; $profile = $row["ID"];
  15. Could be my eyes as mentioned before, but isn't that what I'm doing here.... $query = "select * from contacts where id = '$getid' "; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults);
  16. Already tried just selecting certain tables, thanks for the reply, but I use SELECT * in my database queries cause I only put the information in each table that I need from that query... I'm not a newbie, just been looking at the code too long and looking for a second set of eyes...
  17. Server information is below. I'm running a query that isn't returning any results, even though I know the information is in the database. Here's the code... $getid = $_GET['id']; mysql_connect("localhost","myusername","mypassword"); //(host, username, password) mysql_select_db("acinquemani_applications") or die("Unable to select database"); //select which database we're using $query = "select * from contacts where id = '$getid' "; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); $title = $row["lname"]; $title2 = $row["fname"]; $profile = $row["ID"]; echo "Hi!$title2 $title $getid $title.) <a href=edit.php?id=$profile>$title2 $title </a> <br>" ; When I put the $getid in the echo part of the code by itself, that comes through ok, but the variables after the query are still just blank. Thanks in advance to anyone that can help! Osyrys Server: Localhost via UNIX socket Server version: 5.0.92-community-log Protocol version: 10 User: acinquemani@localhost MySQL charset: UTF-8 Unicode (utf8) Web server cpsrvd 11.28.87 MySQL client version: 5.0.92 PHP extension: mysql
×
×
  • 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.