Re: [PHP-DB] Re: Formatting

2012-11-25 Thread Matt Pelmear
FYI, this really is not the appropriate mailing list for these types of 
questions.


Are you positive they are empty lines? i.e., are they in the html code 
of the page, or only appear as empty space in the rendered page?


If they are just in the rendered page, in addition to losing the 
"" in the middle of your table (as someone has suggested), you 
might also want to check your stylesheets. In particular, this looks 
like it could cause some strange things to happen depending on what 
you're doing with it:



Try loading up firebug and looking at the table element and the elements 
around it to see if there is some strange padding. Or, try disabling any 
stylesheets you are loading with the page to see if it still renders in 
an undesirable way.



Good luck,
-Matt

On 11/25/2012 07:05 PM, Jim Giner wrote:

On 11/25/2012 5:39 PM, Ethan Rosenberg, PhD wrote:

List -

Any more ideas.
=
Keep on debugging

jg

Jim -

I've been at this for a few weeks, and am stuck.
Thanks for all your help.

Ethan

+

On Nov 25, 2012, at 1:59 PM, "Ethan Rosenberg, PhD"
 wrote:


On 11/25/2012 12:56 PM, Jim Giner wrote:


On 11/25/2012 12:46 PM, Ethan Rosenberg, PhD wrote:

Dear list -

When I run the following code, the results are preceded by at 
least one
screen full of blank lines. I am showing you a large code block 
since I

do not know where the error is:

 if(isset($_REQUEST['Sex'])&& trim($_POST['Sex']) != '' )
 {
 if ($_REQUEST['Sex'] === "0")
 {
 $sex = 'Male';
 }

 else
 {
 $sex = 'Female';
 }

  }
 $allowed_fields = array
 ('Site' => 's',  'MedRec' => 'i', 'Fname' => 's',
'Lname' => 's','Phone'=> 's',   'Height' => 'i',   'Sex' => 's',
 'Hx' => 's','Bday' => 's',  'Age' => 'i'
 );

 if(empty($allowed_fields))
 {
  echo "ouch";
 }

 // Configure the query and the acceptable params to put
into the WHERE clause
 $sql12 = 'SELECT * FROM Intake3 WHERE 1';

// Magically put everything together
 $types = '';
 $args = array();
 foreach( $allowed_fields as $k => $type )
 {
  if( !array_key_exists( $k, $allowed_fields ) )
 continue;
 else
 {
 if( ($_POST[$k]) != '')
 {
 $args[] = &$_POST[$k]; // Note the 
addition of

the ampersand here
 $types .= $type;
 $sql12 .= " AND ($k = ?)";
 }
 }
 }
 $stmt = mysqli_stmt_init($cxn);
 mysqli_stmt_prepare( $stmt, $sql12 );

 if( !$stmt )
 throw new Exception( 'Error preparing statement' );

 // Put the statement and types variables at the front of
the params to pass to mysqli_stmt_bind_param()
 array_unshift( $args, $stmt, $types ); // Note that I've
moved this call. Apparently it doesn't pass back the result. I guess
sometimes I just forget these things.

 // mysqli_stmt_bind_param()
 if( !call_user_func_array( 'mysqli_stmt_bind_param',
$args ) )
 throw new Exception( 'Failed calling
mysqli_stmt_bind_param' );

 if( !mysqli_stmt_execute( $stmt ) )
 throw new Exception( 'Error while executing
statement' );

 mysqli_stmt_bind_result( $stmt,  $Site, $MedRec, $Fname,
$Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age);




 if(count($errors_array) == 0)
 {


?>
Search Results





Site
Medical Record
First Name
Last Name
Phone
Height
Sex
History
Birthday
Age



\n";
 $_SESSION['exe'] = 2;
?>
  
  
  
  
  
  
  

  
  
\n";
 $i = $i +1;

 }
 } while (mysqli_stmt_fetch($stmt)); //end do-while
 $imax = $i;
 echo "";
 echo "";
 echo "";

 }//end count($errors_array)

Help and advice, please

Ethan


If this is the ACTUAL code you are executing you need to remember to
NOT include any blank lines.  Each and every one gets echoed to the
client and with all the blank lines I see above, that could very well
be a full but empty page.


+
Jim -

Thank you.

I removed all the blank lines, and get the same behavior.

Ethan

Ethan


I see nothing in this code but you really should do some more 
debugging.  Add some echos all around in your script so you can see 
where the blank lines are coming from.  Come on - we can't do your 
work for you - you have to be creative and find a way to isolate and 
identify your problem.





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



Re: [PHP-DB] Re: Formatting

2012-11-25 Thread Jim Giner

On 11/25/2012 5:39 PM, Ethan Rosenberg, PhD wrote:

List -

Any more ideas.
=
Keep on debugging

jg

Jim -

I've been at this for a few weeks, and am stuck.
Thanks for all your help.

Ethan

+

On Nov 25, 2012, at 1:59 PM, "Ethan Rosenberg, PhD"
 wrote:


On 11/25/2012 12:56 PM, Jim Giner wrote:


On 11/25/2012 12:46 PM, Ethan Rosenberg, PhD wrote:

Dear list -

When I run the following code, the results are preceded by at least one
screen full of blank lines. I am showing you a large code block since I
do not know where the error is:

 if(isset($_REQUEST['Sex'])&& trim($_POST['Sex']) != '' )
 {
 if ($_REQUEST['Sex'] === "0")
 {
 $sex = 'Male';
 }

 else
 {
 $sex = 'Female';
 }

  }
 $allowed_fields = array
 ('Site' => 's',  'MedRec' => 'i', 'Fname' => 's',
'Lname' => 's','Phone'=> 's',   'Height' => 'i',   'Sex' => 's',
 'Hx' => 's','Bday' => 's',  'Age' => 'i'
 );

 if(empty($allowed_fields))
 {
  echo "ouch";
 }

 // Configure the query and the acceptable params to put
into the WHERE clause
 $sql12 = 'SELECT * FROM Intake3 WHERE 1';

// Magically put everything together
 $types = '';
 $args = array();
 foreach( $allowed_fields as $k => $type )
 {
  if( !array_key_exists( $k, $allowed_fields ) )
 continue;
 else
 {
 if( ($_POST[$k]) != '')
 {
 $args[] = &$_POST[$k]; // Note the addition of
the ampersand here
 $types .= $type;
 $sql12 .= " AND ($k = ?)";
 }
 }
 }
 $stmt = mysqli_stmt_init($cxn);
 mysqli_stmt_prepare( $stmt, $sql12 );

 if( !$stmt )
 throw new Exception( 'Error preparing statement' );

 // Put the statement and types variables at the front of
the params to pass to mysqli_stmt_bind_param()
 array_unshift( $args, $stmt, $types ); // Note that I've
moved this call. Apparently it doesn't pass back the result. I guess
sometimes I just forget these things.

 // mysqli_stmt_bind_param()
 if( !call_user_func_array( 'mysqli_stmt_bind_param',
$args ) )
 throw new Exception( 'Failed calling
mysqli_stmt_bind_param' );

 if( !mysqli_stmt_execute( $stmt ) )
 throw new Exception( 'Error while executing
statement' );

 mysqli_stmt_bind_result( $stmt,  $Site, $MedRec, $Fname,
$Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age);




 if(count($errors_array) == 0)
 {


?>
Search Results





Site
Medical Record
First Name
Last Name
Phone
Height
Sex
History
Birthday
Age



\n";
 $_SESSION['exe'] = 2;
?>
  
  
  
  
  
  
  

  
  
\n";
 $i = $i +1;

 }
 } while (mysqli_stmt_fetch($stmt)); //end do-while
 $imax = $i;
 echo "";
 echo "";
 echo "";

 }//end count($errors_array)

Help and advice, please

Ethan


If this is the ACTUAL code you are executing you need to remember to
NOT include any blank lines.  Each and every one gets echoed to the
client and with all the blank lines I see above, that could very well
be a full but empty page.


+
Jim -

Thank you.

I removed all the blank lines, and get the same behavior.

Ethan

Ethan


I see nothing in this code but you really should do some more debugging. 
 Add some echos all around in your script so you can see where the 
blank lines are coming from.  Come on - we can't do your work for you - 
you have to be creative and find a way to isolate and identify your problem.


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



Re: [PHP-DB] Re: Formatting

2012-11-25 Thread Karl DeSaulniers


On Nov 25, 2012, at 6:25 PM, tamouse mailing lists wrote:

On Sun, Nov 25, 2012 at 4:40 PM, Karl DeSaulniers > wrote:
Your also using a combination of  and . I am thinking that  
you have

columns and that they lay next to each other.
Lose the  and just use 


Hmm, well, no, it looks like the table header columns are in fact just
table header columns, and table data columns are just table data
columns. These are structurally different things;  and  mean
different things, appropriately.  may be rendered different than
 when there are no style sheets, or by tty devices and screen
readers, etc.

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




Oh, ok. Then disregard that statement from my reply.
I admit I did not load the code but read it only in my email.

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP-DB] Re: Formatting

2012-11-25 Thread tamouse mailing lists
On Sun, Nov 25, 2012 at 4:40 PM, Karl DeSaulniers  wrote:
> Your also using a combination of  and . I am thinking that you have
> columns and that they lay next to each other.
> Lose the  and just use 

Hmm, well, no, it looks like the table header columns are in fact just
table header columns, and table data columns are just table data
columns. These are structurally different things;  and  mean
different things, appropriately.  may be rendered different than
 when there are no style sheets, or by tty devices and screen
readers, etc.

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



Re: [PHP-DB] Re: Formatting

2012-11-25 Thread Karl DeSaulniers


On Nov 25, 2012, at 11:56 AM, Jim Giner wrote:


On 11/25/2012 12:46 PM, Ethan Rosenberg, PhD wrote:

Dear list -

When I run the following code, the results are preceded by at least  
one
screen full of blank lines. I am showing you a large code block  
since I

do not know where the error is:

if(isset($_REQUEST['Sex'])&& trim($_POST['Sex']) != '' )
{
if ($_REQUEST['Sex'] === "0")
{
$sex = 'Male';
}

else
{
$sex = 'Female';
}

 }
$allowed_fields = array
('Site' => 's',  'MedRec' => 'i', 'Fname' => 's',
'Lname' => 's','Phone'=> 's',   'Height' => 'i',   'Sex' => 's',
'Hx' => 's','Bday' => 's',  'Age' => 'i'
);

if(empty($allowed_fields))
{
 echo "ouch";
}

// Configure the query and the acceptable params to put
into the WHERE clause
$sql12 = 'SELECT * FROM Intake3 WHERE 1';

   // Magically put everything together
$types = '';
$args = array();
foreach( $allowed_fields as $k => $type )
{
 if( !array_key_exists( $k, $allowed_fields ) )
continue;
else
{
if( ($_POST[$k]) != '')
{
$args[] = &$_POST[$k]; // Note the addition  
of

the ampersand here
$types .= $type;
$sql12 .= " AND ($k = ?)";
}
}
}
$stmt = mysqli_stmt_init($cxn);
mysqli_stmt_prepare( $stmt, $sql12 );

if( !$stmt )
throw new Exception( 'Error preparing statement' );

// Put the statement and types variables at the front of
the params to pass to mysqli_stmt_bind_param()
array_unshift( $args, $stmt, $types ); // Note that I've
moved this call. Apparently it doesn't pass back the result. I guess
sometimes I just forget these things.

// mysqli_stmt_bind_param()
if( !call_user_func_array( 'mysqli_stmt_bind_param',  
$args ) )

throw new Exception( 'Failed calling
mysqli_stmt_bind_param' );

if( !mysqli_stmt_execute( $stmt ) )
throw new Exception( 'Error while executing  
statement' );


mysqli_stmt_bind_result( $stmt,  $Site, $MedRec, $Fname,
$Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age);




if(count($errors_array) == 0)
{


?>
Search Results





Site
Medical Record
First Name
Last Name
Phone
Height
Sex
History
Birthday
Age



\n";
$_SESSION['exe'] = 2;
?>
  
  
  
  
  
  
  

  
  
\n";
$i = $i +1;

}
} while (mysqli_stmt_fetch($stmt)); //end do-while
$imax = $i;
echo "";
echo "";
echo "";

}//end count($errors_array)

Help and advice, please

Ethan

If this is the ACTUAL code you are executing you need to remember to  
NOT include any blank lines.  Each and every one gets echoed to the  
client and with all the blank lines I see above, that could very  
well be a full but empty page.


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




Ethan

What is up with this line of code?
...

Age




Why is that closing div inside your table? Big no no. That closing div  
is breaking your table structure.

Should be more like:
...
Age




if your wrapping your table with a div that is, and if that  is  
the end of the table. Otherwise remove that  or move it to after  
the  it wraps.


Also, why are you using ? Set the align attribute align="center"> or inline style attribute to  or better yet, set a class or id to the table and set  
the style of the table in your css.

css:
.recordsTable { text-align:center; }
html:


Your also using a combination of  and . I am thinking that you  
have columns and that they lay next to each other.

Lose the  and just use 

For this line:

Search Results


You could do something like

Search Results
or even
Search Results

Also, you may want to read up on using  instead of  as they  
are quicker at loading.


My 2ยข

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP-DB] Re: Formatting

2012-11-25 Thread Ethan Rosenberg, PhD

List -

Any more ideas.
=
Keep on debugging

jg

Jim -

I've been at this for a few weeks, and am stuck.
Thanks for all your help.

Ethan

+

On Nov 25, 2012, at 1:59 PM, "Ethan Rosenberg, PhD" 
 wrote:



On 11/25/2012 12:56 PM, Jim Giner wrote:


On 11/25/2012 12:46 PM, Ethan Rosenberg, PhD wrote:

Dear list -

When I run the following code, the results are preceded by at least one
screen full of blank lines. I am showing you a large code block since I
do not know where the error is:

 if(isset($_REQUEST['Sex'])&& trim($_POST['Sex']) != '' )
 {
 if ($_REQUEST['Sex'] === "0")
 {
 $sex = 'Male';
 }

 else
 {
 $sex = 'Female';
 }

  }
 $allowed_fields = array
 ('Site' => 's',  'MedRec' => 'i', 'Fname' => 's',
'Lname' => 's','Phone'=> 's',   'Height' => 'i',   'Sex' => 's',
 'Hx' => 's','Bday' => 's',  'Age' => 'i'
 );

 if(empty($allowed_fields))
 {
  echo "ouch";
 }

 // Configure the query and the acceptable params to put
into the WHERE clause
 $sql12 = 'SELECT * FROM Intake3 WHERE 1';

// Magically put everything together
 $types = '';
 $args = array();
 foreach( $allowed_fields as $k => $type )
 {
  if( !array_key_exists( $k, $allowed_fields ) )
 continue;
 else
 {
 if( ($_POST[$k]) != '')
 {
 $args[] = &$_POST[$k]; // Note the addition of
the ampersand here
 $types .= $type;
 $sql12 .= " AND ($k = ?)";
 }
 }
 }
 $stmt = mysqli_stmt_init($cxn);
 mysqli_stmt_prepare( $stmt, $sql12 );

 if( !$stmt )
 throw new Exception( 'Error preparing statement' );

 // Put the statement and types variables at the front of
the params to pass to mysqli_stmt_bind_param()
 array_unshift( $args, $stmt, $types ); // Note that I've
moved this call. Apparently it doesn't pass back the result. I guess
sometimes I just forget these things.

 // mysqli_stmt_bind_param()
 if( !call_user_func_array( 'mysqli_stmt_bind_param', $args ) )
 throw new Exception( 'Failed calling
mysqli_stmt_bind_param' );

 if( !mysqli_stmt_execute( $stmt ) )
 throw new Exception( 'Error while executing statement' );

 mysqli_stmt_bind_result( $stmt,  $Site, $MedRec, $Fname,
$Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age);




 if(count($errors_array) == 0)
 {


?>
Search Results





Site
Medical Record
First Name
Last Name
Phone
Height
Sex
History
Birthday
Age



\n";
 $_SESSION['exe'] = 2;
?>
  
  
  
  
  
  
  

  
  
\n";
 $i = $i +1;

 }
 } while (mysqli_stmt_fetch($stmt)); //end do-while
 $imax = $i;
 echo "";
 echo "";
 echo "";

 }//end count($errors_array)

Help and advice, please

Ethan


If this is the ACTUAL code you are executing you need to remember to NOT 
include any blank lines.  Each and every one gets echoed to the client and with 
all the blank lines I see above, that could very well be a full but empty page.


+
Jim -

Thank you.

I removed all the blank lines, and get the same behavior.

Ethan

Ethan



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



[PHP-DB] Re: Formatting

2012-11-25 Thread Jim Giner

On 11/25/2012 12:46 PM, Ethan Rosenberg, PhD wrote:

Dear list -

When I run the following code, the results are preceded by at least one
screen full of blank lines. I am showing you a large code block since I
do not know where the error is:

 if(isset($_REQUEST['Sex'])&& trim($_POST['Sex']) != '' )
 {
 if ($_REQUEST['Sex'] === "0")
 {
 $sex = 'Male';
 }

 else
 {
 $sex = 'Female';
 }

  }
 $allowed_fields = array
 ('Site' => 's',  'MedRec' => 'i', 'Fname' => 's',
'Lname' => 's','Phone'=> 's',   'Height' => 'i',   'Sex' => 's',
 'Hx' => 's','Bday' => 's',  'Age' => 'i'
 );

 if(empty($allowed_fields))
 {
  echo "ouch";
 }

 // Configure the query and the acceptable params to put
into the WHERE clause
 $sql12 = 'SELECT * FROM Intake3 WHERE 1';

// Magically put everything together
 $types = '';
 $args = array();
 foreach( $allowed_fields as $k => $type )
 {
  if( !array_key_exists( $k, $allowed_fields ) )
 continue;
 else
 {
 if( ($_POST[$k]) != '')
 {
 $args[] = &$_POST[$k]; // Note the addition of
the ampersand here
 $types .= $type;
 $sql12 .= " AND ($k = ?)";
 }
 }
 }
 $stmt = mysqli_stmt_init($cxn);
 mysqli_stmt_prepare( $stmt, $sql12 );

 if( !$stmt )
 throw new Exception( 'Error preparing statement' );

 // Put the statement and types variables at the front of
the params to pass to mysqli_stmt_bind_param()
 array_unshift( $args, $stmt, $types ); // Note that I've
moved this call. Apparently it doesn't pass back the result. I guess
sometimes I just forget these things.

 // mysqli_stmt_bind_param()
 if( !call_user_func_array( 'mysqli_stmt_bind_param', $args ) )
 throw new Exception( 'Failed calling
mysqli_stmt_bind_param' );

 if( !mysqli_stmt_execute( $stmt ) )
 throw new Exception( 'Error while executing statement' );

 mysqli_stmt_bind_result( $stmt,  $Site, $MedRec, $Fname,
$Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age);




 if(count($errors_array) == 0)
 {


?>
Search Results





Site
Medical Record
First Name
Last Name
Phone
Height
Sex
History
Birthday
Age



\n";
 $_SESSION['exe'] = 2;
?>
  
  
  
  
  
  
  

  
  
\n";
 $i = $i +1;

 }
 } while (mysqli_stmt_fetch($stmt)); //end do-while
 $imax = $i;
 echo "";
 echo "";
 echo "";

 }//end count($errors_array)

Help and advice, please

Ethan

If this is the ACTUAL code you are executing you need to remember to NOT 
include any blank lines.  Each and every one gets echoed to the client 
and with all the blank lines I see above, that could very well be a full 
but empty page.


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



[PHP-DB] Formatting

2012-11-25 Thread Ethan Rosenberg, PhD

Dear list -

When I run the following code, the results are preceded by at least one 
screen full of blank lines. I am showing you a large code block since I 
do not know where the error is:


if(isset($_REQUEST['Sex'])&& trim($_POST['Sex']) != '' )
{
if ($_REQUEST['Sex'] === "0")
{
$sex = 'Male';
}

else
{
$sex = 'Female';
}

 }
$allowed_fields = array
('Site' => 's',  'MedRec' => 'i', 'Fname' => 's', 
'Lname' => 's','Phone'=> 's',   'Height' => 'i',   'Sex' => 's',

'Hx' => 's','Bday' => 's',  'Age' => 'i'
);

if(empty($allowed_fields))
{
 echo "ouch";
}

// Configure the query and the acceptable params to put 
into the WHERE clause

$sql12 = 'SELECT * FROM Intake3 WHERE 1';

   // Magically put everything together
$types = '';
$args = array();
foreach( $allowed_fields as $k => $type )
{
 if( !array_key_exists( $k, $allowed_fields ) )
continue;
else
{
if( ($_POST[$k]) != '')
{
$args[] = &$_POST[$k]; // Note the addition of 
the ampersand here

$types .= $type;
$sql12 .= " AND ($k = ?)";
}
}
}
$stmt = mysqli_stmt_init($cxn);
mysqli_stmt_prepare( $stmt, $sql12 );

if( !$stmt )
throw new Exception( 'Error preparing statement' );

// Put the statement and types variables at the front of 
the params to pass to mysqli_stmt_bind_param()
array_unshift( $args, $stmt, $types ); // Note that I've 
moved this call. Apparently it doesn't pass back the result. I guess 
sometimes I just forget these things.


// mysqli_stmt_bind_param()
if( !call_user_func_array( 'mysqli_stmt_bind_param', $args ) )
throw new Exception( 'Failed calling mysqli_stmt_bind_param' );

if( !mysqli_stmt_execute( $stmt ) )
throw new Exception( 'Error while executing statement' );

mysqli_stmt_bind_result( $stmt,  $Site, $MedRec, $Fname, 
$Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age);





if(count($errors_array) == 0)
{


?>
Search Results




frame="box" style="table-layout: fixed;">


Site
Medical Record
First Name
Last Name
Phone
Height
Sex
History
Birthday
Age



$vara2 = array(array($Site, $MedRec, $Fname, 
$Lname, $Phone, $Height, $Sex, $Hx, $Bday, $Age));


$vara2[$i][0]= $Site;
$vara2[$i][1]= $MedRec;
$vara2[$i][2]= $Fname;
$vara2[$i][3]= $Lname;
$vara2[$i][4]= $Phone;
$vara2[$i][5]= $Height;
$vara2[$i][6]= $Sex;
$vara2[$i][7]= $Hx;
$vara2[$i][8]= $Bday;
$vara2[$i][9]= $Age;

echo "\n";
$_SESSION['exe'] = 2;
?>
  
  
  
  
  
  
  

  
  
\n";
$i = $i +1;

}
} while (mysqli_stmt_fetch($stmt)); //end do-while
$imax = $i;
echo "";
echo "";
echo "";

}//end count($errors_array)

Help and advice, please

Ethan


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