taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
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. -
Output count result to html even if 0
taquitosensei replied to gamma1itman's topic in PHP Coding Help
You could try this $resulta=($result<1)?0:$result; -
MP3 files - selecting a start and end point using PHP
taquitosensei replied to willothewisp's topic in PHP Coding Help
What happens if you run your ffmpeg command on the command line? That would be the first thing to check. If that works then it's probably an issue with permissions for php creating the file. -
Arrays from MySQL database contains no data? (Simple Q)
taquitosensei replied to rjt90's topic in PHP Coding Help
Then you need to explode it before you do this. foreach ($var_hook as $id) { $series[$id] = array(); } It's a string because you imploded it before your sql. -
Arrays from MySQL database contains no data? (Simple Q)
taquitosensei replied to rjt90's topic in PHP Coding Help
or "SELECT * FROM data WHERE data_id IN (".implode(",", $var_hook).") ORDER BY time_id ASC" -
This will substract two dates and give you the difference in hours/minutes. Like DaveyK said if you add 7 days to a timestamp then subtract the original timestamp from it. You will always get exactly 7 days. $diff = strtotime($timestamp2) - strtotime($timestamp1); $hours = floor($diff / 3600); $diff %= 3600; $minutes = floor($diff / 60);
-
You can do print_r($_REQUEST); at the top of phpdoc.php to see what kind of values are actually being posted. If you do that you should be able to see right away why this isn't working.
-
It looks like you're not selecting the size. SELECT Food,Calories FROM food order by Food
-
How permanent do you want it? If it's permanent permanent I would store it in a database somewhere. If it's just somewhat permanent, since you're already using jQuery, use jQuery.ajax to post to server and store a session variable. Then use that session variable to determine whether it's dead or not when initially loading the page.
-
It does effect the query. Because in first query the value you're getting is '' The second query you're getting a number.
-
As far as I know UNION removes duplicate rows, so the count(distinct contactid) in the second part would make it not a distinct row. So in your query you're getting everything, then everything with activity in the last week.
-
Making the result of a variable a variable itself
taquitosensei replied to elmas156's topic in PHP Coding Help
use a double $$ $$row[0]="n"; -
Call to undefined function sqlsrv_connect()
taquitosensei replied to ncurran217's topic in PHP Coding Help
Did you install the php drivers? http://www.microsoft.com/en-us/download/details.aspx?id=20098 -
Also to make this cleaner you could do something like this $fields=array("objava","vpr01","vpr03","etc"); foreach($fields as $field) { if(isset($_POST[$field])) { fwrite($fh, $_POST[$field]."\r\n"); } }
-
Quick question that is driving me insane.
taquitosensei replied to amg182's topic in PHP Coding Help
you're outputting a blank line before the session start which starts the headers so then your session start can't start. -
pear is a set of php files. If your web server can parse php files then you can use pear. It's just not in the default location for the operating system. Just upload the "pear" folder from your local machine to the web server. Then set the include path. Then call the files as normal.