taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
or if(!$_SESSION['auth'])
-
where does the $sec1 array come from? I don't see it in the code you posted. probably supposed to be $sec1 = unserialize ($data['sec1']);
-
it looks like you're modifying oscmax or oscommerce. You should ask on one of their forums. They would be more help.
-
if you put this ini_set('display_errors',1); error_reporting(E_ALL); at the top of your script it should've give you something along these lines PHP Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in test.php on line 19 Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in test.php on line 19 which is this line if (isset($row['id2'] && $row['id2'] != $id2 )) which should be if (isset($row['id2']) && $row['id2'] != $id2 )
-
When doing addition, how to have it output a leading zero?
taquitosensei replied to ghurty's topic in PHP Coding Help
use sprintf to format it echo sprintf("%04d",$time); -
your live server was set to not display warnings. You localhost is set to show them. They were there you just couldn't see them. You have output either in your config.php or in this file before the session_start(); probably the extra line between <html> and <head>. But could be something in your config.php also.
-
Split MySQL results across multiple tables
taquitosensei replied to jonnyuk3's topic in PHP Coding Help
you could do something like this $query = "SELECT * FROM product_stockist WHERE $cat='Y' ORDER BY Region"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $results[$region]=$row; } echo "<table>"; foreach($results as $regionname=>$region) { echo "<tr><td>"; echo "<table width=100% align=center callpadding=2 cellspacing=0>"; echo "<tr><td colspan='5' align='center'>$regionname</td></tr>"; foreach($region as $row) { echo "<tr>"; echo "<td>{$row['Account_Name']} </td>". "<td>{$row['Address_Line_1']} </td>". "<td>{$row['Address_Line_2']} </td>". "<td>{$row['Address_Line_4']} </td>". "<td>{$row['Post_Code']} </td>". "<td>{$row['Region']} </td>"; echo "</tr>"; } echo "</td></tr></table>"; } echo "</table>"; -
Usually a blank page means you have a fatal error in your script and displaying errors is turned off. You can put this at the top of your script while developing to help out with debugging and it would have given you the same information jl5501 gave. Plus any other errors on the page. ini_set('display_errors',1); error_reporting(E_ALL);
-
specify which table variable to use after a JOIN
taquitosensei replied to jeff5656's topic in PHP Coding Help
$consultsq1 = "SELECT *,thecorrecttable.pod FROM icu INNER JOIN bundle ON icu.id_incr = bundle.pt_id "; $result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ()); for($n=0;$row = mysql_fetch_assoc ($result);$n++) { echo $row['pod']; } -
How to grab the index of the first "row" in an array..??
taquitosensei replied to physaux's topic in PHP Coding Help
something like this. There's probably an easier way. function getMaxIndex($array) { $oldindex=0; foreach($array as $index=>$value) { if($index>$oldindex) { $savedindex=$index; } $oldindex=$index; } return $savedindex; } then $array=array(21=>33,19=>3,12=>2); $maxindex=getMaxIndex($array); -
I don't think it will parse the php that way. Try this >>>>>>>>>PHP CODES<<<<<<<<<<<<<< mysql_connect("localhost", "admin", "Pass") or die(mysql_error()); mysql_select_db("movedb") or die(mysql_error()); $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); $data = mysql_query("SELECT * FROM sheet1sa WHERE upper($field) LIKE'%$find%'"); while($result = mysql_fetch_array( $data )) { // ?> <table width="400" border="0" class="sample"> <tr> <td width="97" rowspan="5"><?php echo $F6; ?></td> <td width="125">Name, Lastname</td> <td width="164"><?php echo $name; ?></td> </tr> <tr> <td>Cell Number </td> <td><?php echo $cell; ?></td> </tr> <tr> <td>Extension Number </td> <td><?php echo $ext; ?></td> </tr> <tr> <td>Office Number </td> <td><?php $F2; ?></td> </tr> <tr> <td>Department</td> <td><?php echo $dep; ?></td> </tr> </table> <br> <br> <?php }
-
no because it's not a style. You're telling the browser not to cache content.
-
if $col is actually a whole number you could do this fwrite($this->fp,"<td class=xl24 width=64 >".(int)$col."</td>");
-
I think what you're really after is not caching at all put this in your <head></head> <head> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> </head> then do another head section after </body> with the same content </body> <head> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> </head>
-
or... age between 16 and 20
-
help limiting number of characters pulled from database
taquitosensei replied to RyanSF07's topic in PHP Coding Help
you were pretty damn close row2['assignment_number'] = $assign; if(strlen($assign)>50){ $assign= substr($assign, 0, 50); } -
the default value is in the function definition function makeSportList($name="Default Value Goes Here", $sportlist=$sport_list) { }
-
close <?php $varto = "myemail@domain.com";?> <input type="hidden" type="text" name="email" value="<?php echo $varto; ?>" <br />
-
use rsort then
-
nm I didn't read the post thoroughly
-
It all depends. Will all your numbers 2 digit numbers? Do you want to keep the highest number or the lowest? for 2 digits and keeping the lowest digit something like this should work. foreach($array as $digit) { if(isset($array[strrev($digit)]) && $digit < strrev($digit)) { unset($array[$strrev[$digit]); } }
-
sprintf echo sprintf("%02d",$code_array['code']); should do it
-
Finding the limit <<-- Loop Problem
taquitosensei replied to paulman888888's topic in PHP Coding Help
try this $my_var=8; $array=array(7,9,11,6); // make sure it's in numerical order sort($array); foreach($array as $test_var) { echo $my_var." | ".$test_var."\r\n"; if($my_var < $test_var) { $result=$test_var; break; } } echo $result; -
stuck- select box not getting list from query
taquitosensei replied to dflow's topic in PHP Coding Help
do this print_r($result); die(); after your switch for the CatID the should tell you what the error is.