Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page PHP to MYSQL varables
Reply
 
Thread Tools Display Modes
(#11 (permalink))
Old
Senior Member
grace1004 is on a distinguished road
 
Posts: 732
Join Date: Dec 2010
Default 07-18-2012, 10:14 AM

d3iti:
On 000webhost.com server, I tested cron job file posted by NeilR on 07-12-2012
(subject: Cron not working for me). The cron job was to write something in a
txt file. When executed manually, the word "hello" was written in the txt file.
However, it didn't work through cron job.

When I tested a cron job with the same file on my Linux server installed in my PC,
it worked fine. That means NeiLR's code is nothing wrong.

Last edited by grace1004; 07-18-2012 at 11:51 AM.
Reply With Quote
Sponsored Links
(#12 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 6,481
Join Date: Jul 2009
Location: Spain
Default 07-18-2012, 08:21 PM

Quote:
Originally Posted by grace1004 View Post
d3iti:
On 000webhost.com server, I tested cron job file posted by NeilR on 07-12-2012
(subject: Cron not working for me). The cron job was to write something in a
txt file. When executed manually, the word "hello" was written in the txt file.
However, it didn't work through cron job.

When I tested a cron job with the same file on my Linux server installed in my PC,
it worked fine. That means NeiLR's code is nothing wrong.
grace1004, thanks again for sharing your trials and experiences.


Recuerda realizar copias de seguridad de tus sitios web. Si este mensaje te ayudó puedes pulsar sobre el botón karma
Reply With Quote
(#13 (permalink))
Old
Member
caboose9792 is on a distinguished road
 
Posts: 55
Join Date: Oct 2010
Default 07-19-2012, 11:15 PM

The txt files seem to be working fine within PHP. I use them for logging updates to the mysql database. That way if the MySQL server goes offline I can still operate the page and update the DB later. My code worked for a few updates over the last 36 hours, as I break up my sql use to try to keep from running afoul the 000's vague TOS. About three hours ago my last attempt (two back to back runs) and the first ran and the second attempt failed.

Attempts after that also failed but I can still access the DB and do other things with the DB just not run UPDATE commands. Also I noticed the other night after posting the HTML that is supposed to be on the bottom of the page is not turning up on pages when the query fails to complete and also the program does not loop. It is like the MySQL quire gets lost or blocked but no errors are shown. Is there limits on the SQL servers that differ from the main servers? The TOS and the help desk is clear as tar on the subject.
Reply With Quote
(#14 (permalink))
Old
Member
caboose9792 is on a distinguished road
 
Posts: 55
Join Date: Oct 2010
Default 07-24-2012, 12:00 AM

Not wanting to give up without knowing what has gone wrong I have been playing with a few more things. I got an interesting result from this code piece:

$road2 =PAL;
if ($road==$road2) { print "PAL is PAL <br>";} else {print "road is not PAL <br>";}

I inserted it ahead of the MySQL quirey posted earlier. What I found the string in the data PAL was not equal to PAL. SO there both the same letters both striped of white space and coded under UTF-8. It explains why the MySQL fails but out of ideas how to bring them into pairaty. The coding sometimes works but usually it doesn't and the same code used elsewhere works fine on the same sight different page.

Any thoughts?
Reply With Quote
(#15 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 6,481
Join Date: Jul 2009
Location: Spain
Default 07-24-2012, 06:44 AM

Hello,

You can try to put quotation marks to delimit character strings:
PHP Code:
$road2 ='PAL';
if (
$road==$road2) { print "PAL is PAL <br>";} else {print "road is not PAL <br>";} 


Recuerda realizar copias de seguridad de tus sitios web. Si este mensaje te ayudó puedes pulsar sobre el botón karma
Reply With Quote
(#16 (permalink))
Old
Member
caboose9792 is on a distinguished road
 
Posts: 55
Join Date: Oct 2010
Default 07-25-2012, 12:52 AM

Like this?

$road1 = "$road";
Reply With Quote
(#17 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 6,481
Join Date: Jul 2009
Location: Spain
Default 07-25-2012, 07:40 AM

Quote:
Originally Posted by caboose9792 View Post
Like this?

$road1 = "$road";
No. Quotes are used when it is a character string (or character) but are not used when using two variables.


Recuerda realizar copias de seguridad de tus sitios web. Si este mensaje te ayudó puedes pulsar sobre el botón karma
Reply With Quote
Reply

Tags
mysql problem, mysql query, php

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com