RE: [PHP-DB] array from html form

2001-10-05 Thread Charles Butler

For one, why are you redefining the array 3 times in that script? ...
I'm trying to follow here... and its not making sense.

-Original Message-
From: Larry Linthicum [mailto:[EMAIL PROTECTED]] 
Sent: Friday, October 05, 2001 12:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] array from html form


Hi
I'm just a PHP hobbiest trying to build a points calculating system
for another hobby, please bear with me.

I need to build a multidimensional array from a html form,
the array  would look like:

$needed_data = array (
array (id = $member_id,
points = $position ),
array ( id = $member_id,
points =$position),
array (id=$member_id,
points = $position);

$member_id  will be used to dynamically build the html form,  $position
will be an integer entered into a text field in that form similar to
this:

Fred($member_id=?)   .. [ enter position=? ]
John)$member_id=?) ..[enter position=?]
etc
etc
[SUBMIT]

IF ( I can get the data into an array like above) {
I can make the rest of the script work }

but that is a big if G ... how can I stucture the form and get
that multidimen array from the single name/value pairs passed from an
html form?


OR
Maybe I can make a normal array work?
I know that enclosing form field names in [] makes them available as an
array


if the form were dynamically built like

PERSONS NAME (from database via $member_id )
 input type = hidden  name = [data] value = $member_id input type =
text name = [data]  next PERSONS NAME (from database via $member_id )
input type = hidden  name = [data] value = $member_id input type =
text name = [data]  next PERSONS NAME (from database via $member_id )
input type = hidden  name = [data] value = $member_id input type =
text name = [data]  etc etc


I think I would then send an array containing all the $member_id (s)
and all the entries into the txt fields

first... am I correct in that?

second  ... is the indexing order known and guaranteed?  in other words
is
$data[0] and $data[1]   OR  $data[12] and $data[13]
ALWAYS going to represent a matched pair?   ( from one line of the
form } or is the indexing of the array subject to variation and may NOT
be in the same order as the [data] fields in the html ?

What if nothing is entered into the txt field?I know that enclosing form
field names in [] makes them available as an array


if the form were dynamically built like

PERSONS NAME (from database via $member_id )
 input type = hidden  name = [data] value = $member_id input type =
text name = [data]  next PERSONS NAME (from database via $member_id )
input type = hidden  name = [data] value = $member_id input type =
text name = [data]  next PERSONS NAME (from database via $member_id )
input type = hidden  name = [data] value = $member_id input type =
text name = [data]  etc etc


I think I would then send an array containing all the $member_id (s)
and all the entries into the txt fields

first... am I correct in that?

second  ... is the indexing order known and guaranteed?  in other words
is
$data[0] and $data[1]   OR  $data[12] and $data[13]
ALWAYS going to represent a matched pair?   ( from one line of the
form } or is the indexing of the array subject to variation and may NOT
be in the same order as the [data] fields in the html ?

What if nothing is entered into the txt field?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: [PHP-WIN] Setting up MySQL for PHP

2001-10-04 Thread Charles Butler

Even with it being on a separate server, setting up MySQL and PHP to
work together is almost flawless, with ODBC and MySQL being enabled by
default on the windows PHP ver, just plugin the code.. To test this
theory you can always use the following code (as I do when setting up a
new server):

?php
$sqlhost = 12.110.x.x;
$sqluser = username;
$sqlpass = password;

$conn = mysql_connect($sqlhost, $sqluser, $sqlpass) or
die(mysql_error());
?

That will test to see if you can connect to the host. Simple :)

For more information, either read the MySQL documentation along with the
PHP documentation, or check out devshed's tutorials. 
--
Charles Butler
[EMAIL PROTECTED]
Research and Development
American Telanet Corp. 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MSSQL error codes :/

2001-10-01 Thread Charles Butler

I'm getting funky error codes, even with doing addslashes($variable); but its not 
escaping the 's, I have even resorted to str_replace() and still nothing

below is error output.
Warning: MS SQL message: Line 1: Incorrect syntax near 'b'. (severity 15) in 
\jtron\home\admin\functions.php on line 82

Warning: MS SQL message: Unclosed quotation mark before the character 
string ')'. (severity 15) in \jtron\home\admin\functions.php on line 82

Warning: MS SQL: Query failed in \jtron\home\admin\functions.php on line 
82


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]