Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 26th, 2005, 4:03 PM   #1
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
Quick Question (hopefully)

You all were are so good I thought I'd test you again. I want, when I insert data into a table to relate to to the others via a master id. In my code for submitting a certain piece of information I try to refer to the id from another table.

Here's the error I get:

Impossible to find an index FULLTEXT corresponding to this list of columns

Here's the code snippet:
//get master id
$add_master = "select id from client_name where match (company) against ('$_POST[add_work_order_client]')";
$master_id = mysql_query($add_master) or die (mysql_error());

Hope this makes sense!
__________________
Lorem ipsum dolor sit amet...
dmorales is offline   Reply With Quote
Old Apr 26th, 2005, 4:47 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Stick curly brackets around the variable to tell PHP it's actually an array, not a string:
... against ('{$_POST[add_work_order_client]}')";
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 26th, 2005, 5:31 PM   #3
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 4 BlazingWolf is on a distinguished road
Just I recommendation but I would set that to a different varible before I did that. Like

$woClient = $_POST[add_work_order_client]

Just a matter of prefercene also you should try to shorten your names a bit. Less you have to type less chance of making a mistake.
__________________
_______________________________
BlazingWolf
BlazingWolf is offline   Reply With Quote
Old Apr 26th, 2005, 6:05 PM   #4
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
thanks guys. as soon as I get an opportunity I'll give it a try and let you kow if it works.

Thanks for he advice too!
__________________
Lorem ipsum dolor sit amet...
dmorales is offline   Reply With Quote
Old Apr 26th, 2005, 9:32 PM   #5
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
remembed to run the variables through addslashes before put into the SQL statement, SQL injection is a problem...
__________________

tempest is offline   Reply With Quote
Old Apr 27th, 2005, 8:12 AM   #6
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
I haven't got it working quite right. I assigned the post value to a variable. but now I get this error:

Syntax error close to 'david' to the line 1

and here's the code again:
$woClient = $_POST['add_work_order_client'];
$add_master = "select id from client_name where match (company) against $woClient";
$master_id = mysql_query($add_master) or die (mysql_error());

First let me make sure I got this right, id is a field I want to choose from. client_name is the table I'm choosing the field from. Match is the other field in that table that must be of equal value to the against which is the post value input by the user.

Is this right?
__________________
Lorem ipsum dolor sit amet...
dmorales is offline   Reply With Quote
Old Apr 27th, 2005, 12:55 PM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Try sticking single quotes around the variable.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:50 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC