Select clause

This is a discussion on Select clause within the MySQL Database forums, part of the Database Forums category; I am attempting to select first and last name from MySQL database newemail using the code below. <?php $name = $...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-21-2007
Bruce B.
 
Posts: n/a
Default Select clause

I am attempting to select first and last name from MySQL database newemail
using the code below.

<?php
$name = $_POST['name'];
$Fname = $_POST['Fname'];

echo "The passed value is $name $Fname\n";


$query = "SELECT emailadd from newemail where name, Fname = '$emailadd'";



and I get an error message.


Error Message:

The passed value is bixby bruce SELECT emailadd from newemail where name,
Fname = ''
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 ' Fname = ''' at
line 1

Can anyone help? TIA


Reply With Quote
  #2 (permalink)  
Old 10-21-2007
Brian Wakem
 
Posts: n/a
Default Re: Select clause

Bruce B. wrote:

> I am attempting to select first and last name from MySQL database newemail
> using the code below.
>
> <?php
> $name = $_POST['name'];
> $Fname = $_POST['Fname'];
>
> echo "The passed value is $name $Fname\n";



Why tell us this? You don't use either in your query.


> $query = "SELECT emailadd from newemail where name, Fname = '$emailadd'";



$emailadd is undefined.


> and I get an error message.
>
>
> Error Message:
>
> The passed value is bixby bruce SELECT emailadd from newemail where name,
> Fname = ''
> 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 ' Fname = '''
> at line 1



The query is total nonsense. You have sent "SELECT emailadd from newemail
where name, Fname = ''" to mysql.


--
Brian Wakem
Reply With Quote
  #3 (permalink)  
Old 10-22-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Select clause

Bruce B. wrote:
> I am attempting to select first and last name from MySQL database newemail
> using the code below.
>
> <?php
> $name = $_POST['name'];
> $Fname = $_POST['Fname'];
>
> echo "The passed value is $name $Fname\n";
>
>
> $query = "SELECT emailadd from newemail where name, Fname = '$emailadd'";
>
>
>
> and I get an error message.
>
>
> Error Message:
>
> The passed value is bixby bruce SELECT emailadd from newemail where name,
> Fname = ''
> 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 ' Fname = ''' at
> line 1
>
> Can anyone help? TIA
>
>
>


That is correct.

where name, Fname =

is invalid syntax. Where name what?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:22 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0