Jump to content

[SOLVED] Column 'fname' in field list is ambiguous


ballhogjoni

Recommended Posts

What does this mean? Column 'fname' in field list is ambiguous

 

this is my code:

 

<?php 
	if (isset($_POST['search_fname'])) {
		$search_fname = $_POST['search_fname'];
		$query = "SELECT fname FROM contact_n_questions, dispo_callBack, dispo_client, dispo_demoSetup, dispo_money, dispo_notContacted, dispo_notInterested, dispo_time, dispo_tooSmall WHERE fname = '{$search_fname}'";
		$result = mysql_query($query) or die(mysql_error());
		if (!mysql_num_rows == "") {
			while($row = mysql_fetch_array($result) or die(mysql_error())) {
				echo $row['fname'].'<br>';
			}
		} else {
			echo 'No Records';
		}
	}
	?>

Link to comment
Share on other sites

SELECT fname FROM contact_n_questions, dispo_callBack, dispo_client, dispo_demoSetup, dispo_money, dispo_notContacted, dispo_notInterested, dispo_time, dispo_tooSmall WHERE fname = '{$search_fname}'

 

 

I don't think that is right, it looks like you are trying to select "fname" from a bunch of different tables, why would you want to do that? Can you tell me what you are trying to do?

Link to comment
Share on other sites

I want to find a specific record in the db. The thing is, i don't know which table the record is in. I don't knwo because the records change from one table to next based on certain criteria and that criteria changes on a daily bases. As the criteria changes the record is passed and then deleted from one table to the next.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.