[PHP-DB] Array Trouble

2003-01-29 Thread Tyler Whitesides
Hi,
I e-mailed this before, but the attachments didnt go through.  I am
designing something that my tech team can use to track the maintenancing
of our school district computers.  I have a table of data (formitems)
that contains tasks that must be completed for that computer depending
on the platform.  I loaded the results from the apple.php form into an
array ($item).  I need to make a row ($makerow) then, assuming all of
the proper columns are there, load each value in the array into its
corresponding column in the database.  For some reason, PHP is not
returning the current value of the array, it is handing MySQL the whole
array.
Any help would be appreciated.

-Tyler
Web and Database Administrator
East Valley School District

?
include './include/dbconnect.php';
include 'accessConnect.php';
include './include/vars.php';
$sql = select * from inventory where ID like $id and notNetworked IS NULL;;
$row = odbc_exec($db, $sql) or die (Could not execute SQL query);
?
html
head
title?= $title ?/title
script language=javascript
function checkAll()
{
?
$sql = SELECT * FROM FORMITEMS WHERE PLATFORM LIKE '%mac%' ORDER BY ID;;
$result = mysql_query($sql);
while($list = mysql_fetch_array($result))
{
echo if(document.form.item$list[id].value == \1\)\n{\ndocument.$list[id].value = 
\2\;\n}\n;
}
?
}
/script
/head
body bgcolor=#CBe5Db link=#405266 vlink=#3F593E alink=#3F593E
div align=center
  center
  table border=0 cellspacing=0 cellpadding=0 width=780
tr
  td width=15 height=15img border=0 src=images/corner_tl.gif width=15 
height=15/td
  td bgcolor=#FF height=15img border=0 src=images/clear.gif 
width=1 height=1/td
  td width=15 height=15img border=0 src=images/corner_tr.gif width=15 
height=15/td
/tr
tr
  td bgcolor=#FF width=15img border=0 src=images/clear.gif 
width=1 height=1/td
  td bgcolor=#FF
table border=0 width=100% cellpadding=0 cellspacing=0
/tr
  tr
td valign=top rowspan=3 bgcolor=#C0C0C0 
background=images/main_bg.gifimg border=0 src=images/clear.gif width=18 
height=1
/td
td valign=topimg border=0 src=./images/logo.png hspace=2 
alt=Computer Maintenance align=top
/td
!--WebAdmin Info---
td valign=top align=rightimg src=./images/macos.gif 
align=lefttable cellpadding=0 cellspacing=0 border=0trtdApple - 
?
echo ID b/tdtdb;
echo $id;
echo /b/td/trtrtdLocation: /tdtdb;
echo odbc_result($row, location);
echo  - ;
echo odbc_result($row, roomNo);
echo /b/td/trtrtdTeacher: /tdtdb;
echo odbc_result($row, teacher);
echo /b/td/trtrtdModel: /tdtdb;
echo odbc_result($row, modelNo);
echo /b/td/trtrtdSerial: /tdtdb;
echo odbc_result($row, serialNo);
echo /b/td/trtrtdMac Address: nbsp;/tdtdb;
echo odbc_result($row, macAddress);
echo /b/td/trtrtdDrop: /tdtdb;
echo odbc_result($row, dropID);
echo /b/td/trtrtdOS: /tdtdb;
echo odbc_result($row, OS);
echo /b/td/trtrtdProcessor: /tdtdb;
echo odbc_result($row, processor);
echo /b/td/tr;
echo trtda 
href='http://support.evsd.org/webadmin/edit_entry.asp?database=newDBfound=singledeviceNum=1autoNo=;
 . odbc_result($row, autoNo) . 'Edit This Info/a/td/tr;
?
/table
!--End WebAdmin Info---
/td
  /tr
tr
td valign=bottom colspan=2
img border=0 src=images/clear.gif width=5 
height=5

/td
/tr
tr
td valign=top colspan=2   
!-Empty Cell---
table border=0 cellpadding=5 cellspacing=7
  tr
td valign=top
!-Maintenance Form---
form method=post action=data.php name=form
table
trtd align=bottomNotbrDone nbsp;nbsp;/tdtdN/A 
nbsp;nbsp;/tdtdDone/tr/tr
?
$sql = SELECT * FROM FORMITEMS WHERE PLATFORM LIKE '%mac%' ORDER BY ID;;
$result = mysql_query($sql);
while($list = mysql_fetch_array($result))
{
echo trtdinput type=radio name=item$list[id] value=\1\ checked/tdtdinput 
type=radio name=item$list[id] value=\2\/tdtdinput type=radio 
name=item$list[id] value=\3\/tdtd$list[item]/td/tr\n;
}
?

Re: [PHP-DB] Array trouble

2003-01-24 Thread Jason Wong
On Friday 24 January 2003 14:18, Tyler Whitesides wrote:

 I have been having a lot of trouble getting an array into the MySQL table
 like I want it.  This is supposed to take the current maintenance tasks
 from a table in the database on apple.php each of these is given a name
 $item[autoNo] where autoNo is the auto_increment id that task is associated
 with.  This is passed to data.php where it is supposed to make a row in the
 maintenanceditems table, then in a loop directly below that it is supposed
 to run the array and place each array value into its associated column in
 the database.  Considering all of the columns exist, I think the problem
 just has to do with how I am pulling the array values out and placing them
 into their column.  Any help would be appreciated. Thanks in advance,

Please post your code and DB schema.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Don't worry if you're a kleptomaniac; you can always take something for it.
*/


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




[PHP-DB] Array trouble

2003-01-23 Thread Tyler Whitesides



Hi,
I have been having a lot of trouble getting an 
array into the MySQL table like I want it. This is supposed to take the 
current maintenance tasks from a table in the database on apple.php each of 
these is given a name $item[autoNo] where autoNo is the auto_increment id that 
task is associated with. This is passed to data.php where it is supposed 
to make a row in the maintenanceditems table, then in a loop directly below that 
it is supposed to run the array and place each array value into its associated 
column in the database. Considering all of the columns exist, I think the 
problem just has to do with how I am pulling the array values out and placing 
them into their column. Any help would be appreciated.
Thanks in advance,
Tyler
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Array trouble

2003-01-23 Thread Tyler Whitesides



Hi,
I have been having a lot of trouble getting an 
array into the MySQL table like I want it. This is supposed to take the 
current maintenance tasks from a table in the database on apple.php each of 
these is given a name $item[autoNo] where autoNo is the auto_increment id that 
task is associated with. This is passed to data.php where it is supposed 
to make a row in the maintenanceditems table, then in a loop directly below that 
it is supposed to run the array and place each array value into its associated 
column in the database. Considering all of the columns exist, I think the 
problem just has to do with how I am pulling the array values out and placing 
them into their column. Any help would be appreciated.
Thanks in advance,
Tyler
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php