taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
Need help echoing COUNT(*) in my report
taquitosensei replied to joesoaper's topic in PHP Coding Help
According to your query it should be stockfig not model COUNT(model) AS stockfig -
mysqli_fetch_array() expects parameter 1 to be mysqli_result
taquitosensei replied to WeBBy421's topic in PHP Coding Help
What data type is your active column and is it storing 'y' and 'n' or is it 1 and 0? Plus I've never used && before. Not sure that works. I've always used "and". -
Not able to export more than ~50K records
taquitosensei replied to natasha_sharma's topic in PHP Coding Help
you might try append "a" instead of "w" so you're not writing to the beginning of the file every time. Not sure if its going through section more than once. The end of the function appears to be missing here. -
The string looks okay as serialized data. More likely than not you have a value that's not the same length as the s: part. I would double check your test data to make sure these match.
-
RSS feed display, limit number of columns
taquitosensei replied to The_WJM's topic in PHP Coding Help
This is an example and you'll have to make it work with your code but something like this would work. $items=array(1,2,3,4,5,6,7,; $html="<table>"; $c=0; foreach($items as $item) { if($c==0) { $html.="<tr>"; } if($c%3==0) { $html.="</tr>"; $c=0; } $html.="<td>".$item."</td>"; $c++; } $html.="</table>"; echo $html; -
I would create an ODBC connection to the database. Then use pdo_odbc. Judging from your phpinfo you'll need to turn on pdo_odbc. It should be in the core php on windows. By adding extension=php_pdo.dll and extension=php_pdo_odbc.dll to php.ini then take a look at http://www.sitepoint.com/using-an-access-database-with-php/ EDIT - I just saw the part about asp 3.0 and this might not 100% apply to you.
-
How to determine 5 seconds instead of 24 hours using timestamp
taquitosensei replied to therocker's topic in PHP Coding Help
exactly like that which is why you did the 60*60*24 to get hours. 60 seconds,60 minutes,24 hours -
How to determine 5 seconds instead of 24 hours using timestamp
taquitosensei replied to therocker's topic in PHP Coding Help
time is the number of seconds since January 1 1970 so just compare it. if(($timestamp2-$timestamp1) < 5) { echo "Less than 5 seconds"; } else { echo "More than 5 seconds"; } -
you need an exit; after the header redirection.Without more info I think that will take care of it. Also...use code tags. It will make it much easier for people to read. if(mail($email,$subject,$messag2,$from)){ header("Location: ../thank-you.html"); exit; }
-
Cron Job! Seems to be something wrong with my php
taquitosensei replied to oracle765's topic in PHP Coding Help
make sure any includes aren't full path not relative and try using /usr/bin/php -f /home/username/public_html/scripts/master.php -
It won't exist the first time you go to the page. As soon as you submit your form it will. So you'll need to check that your for has been submitted before trying to process $_POST['pass']. Something like if(isset($_POST['yourfieldname'])) { // do your processing here }
-
Onclick event calling php function from generated code
taquitosensei replied to krkec's topic in PHP Coding Help
if you are assembling the javascript on the server this should probably look more like... -
Call to a member function query() on a non-object
taquitosensei replied to travisco87's topic in PHP Coding Help
It means you're either not initializing your $DBH or it's not actually an object. -
you could use session_set_save_handler to override session handling then run code when the session is destroyed.
-
Usually that means it's not an array. Try print_r($custexp2); to make sure it contains what you expect it to.
-
PHP not checking if statement for variable
taquitosensei replied to JamesKoash's topic in PHP Coding Help
you need to use == otherwise you're changing the value to TRUE if($showlog ==True) even better use if($showlogo) That checks for true/false -
mysql query/fetch problem with $_GET['']
taquitosensei replied to bujashaka's topic in PHP Coding Help
I know it's text that's why I told you that. -
mysql query/fetch problem with $_GET['']
taquitosensei replied to bujashaka's topic in PHP Coding Help
you have to surround it in quotes if it's text $sql .= "WHERE menu_name='" . $_GET['page']."'"; -
With the way you have your query if the number of columns is different than the number of columns you're trying to insert it will fail. I usually specify my column names. insert into table(column1,column2,column3) values('value1','value2','value3')
-
where does $logOptions_id come from and is it an array? Because if $friendArray is an array you probably don't want to compare it to $logOptions_id.
-
Not the php just the html ouput that the php generated.
-
Keep checkbox checked after submit refresh
taquitosensei replied to user4245's topic in PHP Coding Help
Try this. You need to check if color is set and if it matches the color of the row you're on in the loop. (isset($_REQUEST['color']) && $_REQUEST['color']==$row['color']) ? 'checked="checked"' : '' -
do print_r($_POST); to verify that your $tuturl is correct.
-
How are you generating your form? You can always create an array of the names. Then loop through and check for them. $radio_array=array("radio1","radio2","etc"); $selected=False; foreach($radio_array as $radio) { if(isset($_REQUEST[$radio] && $_REQUEST['radio'])) { $selected=True; } } if($selected) { // do whatever you need to do here. }
-
PHP error %3C?php echo $_SERVER['PHP_SELF']
taquitosensei replied to priya117's topic in PHP Coding Help
for some reason instead of parsing the php it's convert the < to %3C Need to see what's at the top of the page.