Jump to content

rscott7706

Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by rscott7706

  1. Here is the message: Lakeside Chamber of Commerce - 2006 Member Listing Unknown column 'a' in 'where clause' I think you have put enough for a day on this.  I truely appreciate your quick response, but I don't want to bother you anymore today on this.  let's let it sit and stew for a while.  Meanwhile i will do some web searches. Again, THANKS!!
  2. Still gives parse error $query = "SELECT * FROM members WHERE "Company_NAME" BETWEEN "a" AND "f" "; Do we need to identify that a to f is the first letter of Company_Name?
  3. Get a parse error: Parse error: parse error, unexpected T_STRING in /home/lakeside/public_html/members_data.php on line 80 That is the query line. I think the code is close though - I will work it, if you could also, i would appreciate it!!
  4. Right, but I guess my problem is just selecting names that start with the letter A-F in the query.  Not so much sort order. I want to have section one, for instance, query on the names that start with a,b,d, e, or f - no other letter.
  5. Hi all, I have a non-profit chamber website.  I put the members in a database and display it with the following code (logon info deleted): <?php echo "<font face=\"verdana\">";     echo "<br />"; $db = mysql_connect("localhost", ""); mysql_select_db("lakeside_chamber"); $query = "SELECT * FROM members GROUP by Company_Name"; $result = mysql_query($query) or die(mysql_error()); echo "<font face=\"arial\">"; while($row = mysql_fetch_array($result)){     echo $row['Company_Name'];     echo "<br />";     echo $row['First_Name']. " " . $row['Last_Name'];     echo "<br />";     echo $row['Address']. " " . $row[''];     echo $row['City']. ", " . $row['State']. " " . $row['Zip_Code'];     echo "<br />";     echo $row['Phone_Number'];     echo "<br />";     echo "<a href=mailto:'$row[Web_Email]'>".$row['Web_Email']."</a>";     echo "<br />";     echo "<a href='$row[Web_Site_Address]'>".$row[Web_Site_Address]."</a>";     echo "<br />";     echo "<br />"; } ?> Which displays a long list of company info.  I would like to display a page like the following: A-F (html so I can link to it) (PHP displays all records with a last name of the letter a to f) G-L (again, html so I can link to it) (PHP displays all records with a last name of the letter g to l) and on for the whole alphabet Now, if we could just tweak the $query = "SELECT * FROM members GROUP by Company_Name"; would be great, then I would put several instances of the code corresponding to the letter series I am trying to display. Any ideas?
  6. Please don't knock me off the baord or anything like that - I am trying to donate and having a heck of a time doing it!! I posted on the "Have You been Helped" are but no one has resonded. here is the text: I don't know if I am going nuts or what. I want to make a second donation as I pledged I would, and will continue in the future with additional pledges. Anyway I go to Paypal, and they want me to sign up for an account. I don't want to do that and am sure I was able to just send the money through a credit card transaction (and is confirmed by the fact I don't yet have a PayPal account). Can I send you a check? If so, give me details and I will get it going. Guys - thanks for this forum. I hope other recognize the your effort and this forum remains on line for a long time.
  7. I am a newbie also, but I think one problem is using e-mail. PHP wants to see this as e minus mail - mathmatical operation. Make it email. And just a suggestion - whay not first or fn and last or ln instead of the long winded titles you have.
  8. First, unless I missed it, you should put a "logout" link. I found myself trapped as logged in. But, the logged in page looked fine to me - I didn't see any problem. I viewed it in IE and Firefox. But, not being able to go back to the main page, I couldn't remeber exactly what it looked like.
  9. [b]That did it!!!![/b] I think - I just want to qualify this so I can take some time to add and delete entries and test it thoroughly. T H A N K Y O U ! ! poirot, joquius, kenrbnsn, craygo - and anyone else I may have forgotten. I appreciate you folks sticking with me through this thing. An additional donation to PHP Freaks will be coming next payday. And I will faithfully click on your sponsors... This site rocks.. [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]
  10. Guys, I do appreciate your input, and I try like crazy to make it work in my particular coding situation, but it seems like we are drifting a bit to an area that is helpful in many situations, but not in this particular one. Ken and poirot, the examples you give are great, but suited for a new query. I have an existing query, with results output. I am trying to get a variable ($ts) to format correctly, but it seems as if there is something impeding it working properly. Here is my code again, if you want I can set up a test database and give you the logon info so you can test your results. Everything we have tried so far does not work with my coding. I have red lined the areas I see as needing attention: $query = "SELECT * FROM openings ORDER BY id desc"; $mysql_result = mysql_query($query, $db); // get each row while($myrow = mysql_fetch_row($mysql_result)) { //get data - eg, reading fields 0 and 1 $id=$myrow[0]; $cpny=$myrow[3]; $cont=$myrow[1]; $ti=$myrow[2]; $ph=$myrow[4]; $em=$myrow[5]; $opn=$myrow[6]; $desc=$myrow[7]; $req=$myrow[8]; $mn=$myrow[9]; $mx=$myrow[10]; $nd=$myrow[11]; [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$ts=$myrow[12];[!--colorc--][/span][!--/colorc--] $dent=$myrow[13]; print "</tr>\n<tr>\n"; // output row from database echo "<td> <h3>Opening ID#: $id</h3> [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]Date Record Entered: $ts[!--colorc--][/span][!--/colorc--]<br><br> Company: $cpny <br> Contact: $cont <br> Title: $ti <br> Phone: $ph <br> E-mail: <a href=mailto:$em>$em </a> <br> Opening: $opn <br> Description: $desc <br> Requirements: $req <br> Min $: $mn <br> Max $: $mx <br> Need Date: $nd <br> Maybe I should try to output the results differently, maybe in a table or something like that. I would just be concerned that I would construct a whole new php coding and get the same results By the way poirot, if I use your example alone, SELECT DATE_FORMAT(row_name, '%M %e, %Y') AS time FROM `table` it does work great! Obviously though then I don't get he other needed fields.
  11. OK, I think this is a great option. Only one shortcoming here - so let's switch gears and see if we can attack from a differennt angle. I can leave the timestamp as a field - I won't even show on the web page - just to sort and delete records in the future. Now, here is the next trick - the input is for a date filed istaken from a web form the users submit. Now, there is no way in html to properly input the date. (I don't think) For instance, if I put a form field that says "Date" - the user is going to enter 06/07/2006 (for instance). I need to translate that to 20060607 prior to proccess.php submitting it to the database. Can we use PHP to do this? [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
  12. kenrbnsn, Thanks for your input, here is what I did: I put the coding (changing your example variable from $ds to $ts since I don't have a $ds in my coding) above the query select as follows: $ts = "20060607"; echo date('m/d/Y',strtotime($ts)); It makes no difference. Man I hate being such a lunk, but it does seem like there is something messing this up, that is stumping us all. Ken on your note of 8:20 am, Change CODE <?php $ts=date('m/d/Y', $myrow[12]); ?> to CODE <?php $ts=date('m/d/Y', strtotime($myrow[12])); ?> Gives me an error: Parse error: parse error, unexpected '<' in /home/egcaorga/public_html/new_site/members-only/jm_postings.php on line 192 Whisch is that code line...
  13. Ok, sorry to be such a bother... I went to my, MYSQL database and changed the field to timestamp(8) If I don't format the variable $ts, it shows 20060607. If I format $ts=date('m/d/Y', $myrow[12]); It shows Date Record Entered: 08/20/1970 I am in an endless loop and fell like I am draining your time (I did send a donation to try to offset this). Should I look for asnother form of displying the data, such as in a table or something? If you look at the original note and the coding, maybe it is how the results are called that is gumming this up.
  14. Wait a minute... This is a whole new dynamic. I have an MYSQL database that has an automatic time stamp field. When I say time stamp, it stamps the date and the time. If I leave the variable $ts alone (don't try to format it), it comes out fine. But in a format that makes it difficult for the uninformed to read. It comes out 20060607 2006 the year, 06 the month, and 07 the day. I am trying to format it to show any variation of: 06/07/2006 By the way, I tried: $ts=time('m/d/Y', $myrow[12]); It results in: Date Record Entered: 1149864994
  15. No, it is timestamp, BASICALLY 20060607 June 7, 2006
  16. It just is not working, here is my formating: $ts=date('m/d/Y', $myrow[12]); Here is the result: [a href=\"http://www.egca.org/new_site/members-only/jm_postings.php\" target=\"_blank\"]jm_postings[/a] Check out how it takes any date (in the month of June, 2006) and makes it 08/20/1970. I have tried every variation, such as $ts=date('r', $myrow[12]); No luck.... I know there is some small thing I am missing, but can't figure it out. [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
  17. poirot, thanks for your quick response, but i am starting to feel like a dunce. By reading your note, I think it says to me I have to make two changes; One at $ts = date("FORMAT_HERE", $myrow[12]); Which I think means put the proper date format I want here, for example: $ts = date("m/d/Y", $myrow[12]); (leaving out the second $ts - because if I keep it I get an error. Then in addition I have to format it somewhere else, but the place I think I need it does not match your second example: Date Record Entered: $ts Am I just not understanding your examples?
  18. Hi guys, I hate to ask for help, but honest I have been reading every post on date formatting and trying the solutions, but I have hit a wall. I will enter some code below. I hope someone will assist me in formatting the variable $ts (timestamp in my MYSQL database) to month, day, year (in whatever form - dosen't matter - 06/07/2006 or June 7, 2006 or any other variation - I don't care). Please, please, put the exact code in, no "select from blah, etc. I have used every coding sample and looked at every example, and the best I come up with coverts the timestamp number to like the 1970's or something like that. Code: =================================================== $query = "SELECT * FROM openings ORDER BY id desc"; $mysql_result = mysql_query($query, $db); // get each row while($myrow = mysql_fetch_row($mysql_result)) { //get data - eg, reading fields 0 and 1 $id=$myrow[0]; $cpny=$myrow[3]; $cont=$myrow[1]; $ti=$myrow[2]; $ph=$myrow[4]; $em=$myrow[5]; $opn=$myrow[6]; $desc=$myrow[7]; $req=$myrow[8]; $mn=$myrow[9]; $mx=$myrow[10]; $nd=$myrow[11]; $ts=$myrow[12]; $dent=$myrow[13]; print "</tr>\n<tr>\n"; // output row from database echo "<td> <h3>Opening ID#: $id</h3> [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]Date Record Entered: $ts<br><br>[!--colorc--][/span][!--/colorc--] Company: $cpny <br> Contact: $cont <br> Title: $ti <br> Phone: $ph <br> E-mail: <a href=mailto:$em>$em </a> <br> Opening: $opn <br> Description: $desc <br> Requirements: $req <br> Min $: $mn <br> Max $: $mx <br> Need Date: $nd <br> ===================================================<br><br></td>\n"; print "<TD></TD>\n"; }
  19. Andy, it's timestamp poirot, it worked great!! Thanks my friend....
  20. Here is my feeble attept. maybe someone can help this real newbie... This (or other variations crash. If i just use the formatting text, it just shows as text in the resulting page. Date Record Entered: ($ts = date("F j, Y, g:i a")<br><br>
  21. In the code below. can Date Record Entered: [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$ts[!--colorc--][/span][!--/colorc--] be date formatted? //get data - eg, reading fields 0 and 1 $id=$myrow[0]; $cpny=$myrow[3]; $cont=$myrow[1]; $ti=$myrow[2]; $ph=$myrow[4]; $em=$myrow[5]; $opn=$myrow[6]; $desc=$myrow[7]; $req=$myrow[8]; $mn=$myrow[9]; $mx=$myrow[10]; $nd=$myrow[11]; $ts=$myrow[12]; print "</tr>\n<tr>\n"; // output row from database echo "<td> Date Record Entered: $ts<br><br> Opening ID#: $id <br> Company: $cpny <br> Contact: $cont <br> Title: $ti <br> Phone: $ph <br> E-mail: <a href=mailto:$em>$em </a> <br> Opening: $opn <br> Description: $desc <br> Requirements: $req <br> Min $: $mn <br> Max $: $mx <br> Need Date: $nd <br>
  22. Crud man... The db.php was an iteration I put up trying to make it work. Then I posted here mistakenly - not remembering I had changed the original. I went back to the original and it still crashes. I think I am just not analytical enough for this php stuff. I know I have looked it over several times, and everthing is (to my knowledge) exactly as it should be. But I know there is something I am missing. But I tire of myself and lack of skills here. Thnks for your help and patience with me...
  23. [!--quoteo(post=376407:date=May 23 2006, 10:32 AM:name=ryanlwh)--][div class=\'quotetop\']QUOTE(ryanlwh @ May 23 2006, 10:32 AM) [snapback]376407[/snapback][/div][div class=\'quotemain\'][!--quotec--] well, in this case dbConnect is not even needed... [/quote] I would tend to agree with you, but it is specifically in the script. Look at it here: [a href=\"http://www.sitepoint.com/article/users-php-sessions-mysql/5\" target=\"_blank\"]http://www.sitepoint.com/article/users-php-sessions-mysql/5[/a] I previously thought that may be the problem before and took it out, but it crashed worse (if there is a "worse"). I also tried coding it with my database logon stuff in this file instead of the include db.php - no change - same error code. I am dumfounded that all these scripts that are supposed to be simple and straighforward seem to crash. I tried Crayon Violent's one at: [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=92613&st=0&p=370773&#entry370773\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...73&#entry370773[/a] It gives me a: Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/egcaorga/public_html/new_site/accesscontrol/access/authenticate.php:9) in /home/egcaorga/public_html/new_site/accesscontrol/access/authenticate.php on line 10 Err:Query
  24. [!--quoteo(post=376398:date=May 23 2006, 10:16 AM:name=ryanlwh)--][div class=\'quotetop\']QUOTE(ryanlwh @ May 23 2006, 10:16 AM) [snapback]376398[/snapback][/div][div class=\'quotemain\'][!--quotec--] it sounds like a funtion defined in the included "db.php". can you show us db.php? [/quote] Sure - with password deleted of course... <?php // db.php mysql_connect("localhost","egcaorga_rscott",""); mysql_select_db("egcaorga_mgt"); ?>
  25. OK folks, I am trying hard not to bother you all with every glitch I hit. It is up to me to learn this stuff and solve my own problems. But, sometimes the wind don't blow, and the grass don't grow... (line from Little Big Man - old movie). I have worked on a problem for hours now, and think it may not be me, but the difference between PHP4 (which my server is running) and the coding I have (PHP5)... I THINK!! Not sure. The crash is at line 39 - dbConnect("egcaorga_mgt"); Messge: Fatal error: Call to undefined function: dbconnect() in /home/egcaorga/public_html/new_site/accesscontrol/accesscontrol.php on line 39 This seems to be a PHP 5 command. Am I going in the right direction? If so, is there an equivalent PHP 4 command? Here is the code: <?php // accesscontrol.php include_once 'common.php'; include_once 'db.php'; session_start(); $uid = isset($_POST['uid']) ? $_POST['uid'] : $_SESSION['uid']; $pwd = isset($_POST['pwd']) ? $_POST['pwd'] : $_SESSION['pwd']; if(!isset($uid)) { ?> <!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> Please Log In for Access </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <h1> Login Required </h1> <p>You must log in to access this area of the site. If you are not a registered user, <a href="signup.php">click here</a> to sign up for instant access!</p> <p><form method="post" action="<?=$_SERVER['PHP_SELF']?>"> User ID: <input type="text" name="uid" size="8" /><br /> Password: <input type="password" name="pwd" SIZE="8" /><br /> <input type="submit" value="Log in" /> </form></p> </body> </html> <?php exit; } $_SESSION['uid'] = $uid; $_SESSION['pwd'] = $pwd; dbConnect("egcaorga_mgt"); $sql = "SELECT * FROM user WHERE userid = '$uid' AND password = PASSWORD('$pwd')"; $result = mysql_query($sql); if (!$result) { error('A database error occurred while checking your '. 'login details.\\nIf this error persists, please '. 'contact admin@egca.org.'); } if (mysql_num_rows($result) == 0) { unset($_SESSION['uid']); unset($_SESSION['pwd']); ?> <!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> Access Denied </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <h1> Access Denied </h1> <p>Your user ID or password is incorrect, or you are not a registered user on this site. To try logging in again, click <a href="<?=$_SERVER['PHP_SELF']?>">here</a>. To register for instant access, click <a href="signup.php">here</a>.</p> </body> </html> <?php exit; } $username = mysql_result($result,0,'fullname'); ?> Thanks in advance... [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
×
×
  • 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.