Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 27th, 2003, 11:43 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Missing something simple

Hello,
Maybe one of you can see what I missed cause I can't. Sql won't work unless I hard code email address. On the $post_return where I show what was submit it shows the var $email..
php Code:
Original - php Code
  1.  
  2. <?
  3. include "../inc/settings.php";
  4. if (isset ($_POST['submit'])) {
  5. $email = $_POST['email'];
  6. $db = mysql_connect("$server", "$datacon", "$password_z");
  7.  
  8.   if (!$db)
  9.   {
  10.      echo "Error: Could not connect to database.  Please try again later.";
  11.      exit;
  12.   }
  13.  
  14.   mysql_select_db("$database");
  15.   $query = "select * from subscribers where subscribers_email = $email";
  16.   //$query = "select * from subscribers where subscribers_email = 'jon@phillipscasa.net'";
  17.   $result = mysql_query($query);
  18.   $num_results = mysql_num_rows($result);
  19.   $count = mysql_num_rows($result);
  20.  
  21.     if ( $count == 0 ){
  22.       // cannot find visitor's email address in the database
  23.       $post_return = "<h1>Opps </h1>";
  24.       $post_return .= "<P>It appears that I don't have your Email Address or you missed type it?<br>";
  25.       $post_return .= "Is this the correct login / email address < $email >";
  26.      
  27.     }
  28.     else{
  29. // the rest works from here
  30. }


any ideas why $email is not reconized in the $query?




[

Reply With Quote
  #2  
Old November 27th, 2003, 12:11 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Missing something simple

try changing the query to this...

$query = "select * from subscribers where subscribers_email ='".$email."'";

the missing single quotes was throwing off the query...

Reply With Quote
  #3  
Old November 27th, 2003, 12:18 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Missing something simple

Thank you so much. Ive have spent 2 hrs changing things here and there and I could not see straight. I knew it was something right in front of my face. Works like a charm....

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Missing something simple


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT