SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict seanmayhew's Avatar
    Join Date
    Aug 2002
    Posts
    209
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retrieving Email Error

    Im trying to pull an email out of my database email field but I keep receiving this error:

    Error performing query: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '@hotmail.com' at line 1


    Here is my select statement:

    PHP Code:
    if(isset($mailPass)){
    $mailPassResult mysql_query("Select * from member where email = $email"); 
    if(!
    $mailPassResult){
    echo(
    "<p>Error performing query: ".mysql_error()."</p>");
     exit();
     }
    while(
    $passViewRow mysql_fetch_array($mailPassResult)){
    $email_address "[email=seanmayhew@hotmail.com]seanmayhew@hotmail.com[/email]";
    $passViewRow["email"];
    $password $passViewRow["password"]; 
    Here is the form that I am submitting:

    Code:
     
    <form action="mailpass.php" method="post" class="chartText">
    								<table width="400" border="0" align="center">
    								  <tr> 
    		<td> <div align="right" class="FormText">Email Address: </div></td>
    		<td><div align="left"> 
    			<input type="text" class="FormText" name="email">
    		  </div></td>
    	  </tr>
    		<tr> 
    		<td> <div align="right"></div></td>
    		<td><div align="left"> 
    			<input type="submit" name="mailPass" value="Send">
    		  </div></td>
    	  </tr>
    	</table>
      </form>
    Any help would be greatly appreciated.

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    put $email in single quotes in your query.

    And don't double post. I removed your other post.
    Aaron Brazell
    Technosailor




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •