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 = $...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 ================== |
![]() |
| Thread Tools | |
| Display Modes | |
|
|