Re: going blind for looking...need eyes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Terion Miller" <webdev.terion@xxxxxxxxx> wrote in message 
news:37405f850902060944y74a7a5e8ndce0c3456a32d320@xxxxxxxxxxxxxxxxx
> Need eyes on this query, it is not inserting, I am going to highlight
> what/where  I thought the problem is (there is no " )but when I add the " 
> it
> then changes the syntax coloring on the rest of the code  in my editor 
> which
> makes me wonder if I'm wrong... argh. and either way it's not inserting 
> ...
>
> ---------------------
> $sql = "INSERT INTO admin (UserName, Password, Name, Email, Property,
> Department, AddWorkOrder, ";
>        $sql .= "ViewAllWorkOrders, ViewNewOrders, ViewNewArt,
> ViewPendingWorkOrders, ViewPendingArtwork, ViewCompletedArt, ";
>        $sql .= "ViewCompletedWorkOrders, SearchWorkOrder, EditWorkOrder,
> DelWorkOrder, ChangeStatus, AddEditAdmin";
>        $sql .= ") VALUES(  '$UserName', '$Password', '$Name', '$Email',
> '$Property', '$Department', '$AddWorkOrder', ";
>        $sql .= "'$ViewAllWorkOrders', '$ViewNewOrders', '$ViewNewArt',
> '$ViewPendingWorkOrders', '$ViewPendingArtwork', ";
>        $sql .= "'$ViewCompletedArt', '$ViewCompletedWorkOrders',
> '$SearchWorkOrder', '$EditWorkOrder', '$DelWorkOrder',  ";
>        $sql .= "'$ChangeStatus', '$AddEditAdmin', '$ViewMyOrders')";
>        $result = mysql_query($sql);
>

Try this for readability
------------
$sql = "INSERT INTO admin SET
  UserName='$UserName',
  Password='$Password',
  Name='$Name',
  Email='$Email',
  Property='$Property',
  Department='$Department',
  AddWorkOrder='$AddWorkOrder',
  ViewAllWorkOrders='$ViewAllWorkOrders',
  ViewNewOrders='$ViewNewOrders',
  ViewNewArt='$ViewNewArt',
  ViewPendingWorkOrders='$ViewPendingWorkOrders',
  ViewPendingArtwork='$ViewPendingArtwork',
  ViewCompletedArt='$ViewCompletedArt',
  ViewCompletedWorkOrders='$ViewCompletedWorkOrders',
  SearchWorkOrder='$SearchWorkOrder',
  EditWorkOrder='$EditWorkOrder',
  DelWorkOrder='$DelWorkOrder',
  ChangeStatus='$ChangeStatus',
  AddEditAdmin='$AddEditAdmin'";
------------

plus there is an extra value with no matching field in the original query. 
$ViewMyOrders has no field assigned to it.

Hope that helps some!

Frank 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux