Jump to content


Photo

I can't see what is stopping this query from going to the DB


  • Please log in to reply
4 replies to this topic

#1 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 04 August 2006 - 03:12 AM

I have checked everything I can think of and cannot figure out what would be stopping this query from loading to the database.  The rest of the form is going to the DB, but this one won't work.  Here is the code and the INCLUDE query.

<?php
$result = mysql_query("SELECT * FROM employees") or die(mysql_error());
echo "Technician Name: <select name='Tech'>";
while($row=mysql_fetch_array($result))
{
  echo"<option value=\"{$row[Employee_ID]}\">{$row[First_Name]}  {$row[Last_Name]}</option>";
}
  echo"</select>";

?></select>



$Technician = $_POST["Tech"];

This is the insert query

mysql_query("INSERT INTO `work`(Work, Sched, Technician, Site, Serial, Hours, Starts, Issue,
Severity, Resolution, Assistance, PartsA, PartsB, PartsC, PartsD, PartsE, PartsF, PartsG, Safety)
VALUES ('$Work', '$Sched', '$Technician', '$Site', '$Serial', '$Hours', '$Starts', '$Issue',
'$Severity', '$Resolution', '$Assistance','$PartsA', '$PartsB', '$PartsC', '$PartsD',
'$PartsE', '$PartsF', '$PartsG', '$Safety')")or die(mysql_error());


#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 04 August 2006 - 04:10 AM

I will say it again, just as in the other thread -- post the interpolated INSERT statement, and you'll see what the problem is.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 04 August 2006 - 04:14 AM

I don't understand what you are saying.  As I have said, I am a newbie, and don't understand what you are suggesting I do.

#4 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 04 August 2006 - 07:39 AM

I have figured out what was causing the problem and have it resolved.  It was a name not being the correct name to go to the DB.  I missed this in the drop box.  Thanks for the help.

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 04 August 2006 - 03:00 PM

Glad you got it working... all I meant was to echo the "final" query string.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users