
greatstar00
Members-
Posts
154 -
Joined
-
Last visited
Never
Everything posted by greatstar00
-
as he said, you made a typo
-
if you encounter this kind of problem try to debug the problem by print out the variables try to copy and paste the variable from the error line debugging is trying to look for value, if they are the proper value the best programmer is not coding, they are debuggers try to find out the run time problem, and solve them coding is simple, finding problem it complex, try to learn to be a debugger (tester) the main role of debugging is look for correct values in the variable, (use copy paste from error line, and echo that variable in php, echo all variable from that line)
-
show is mysql reserve word add ` ` (left of 1, top of tab) around show
-
add where cause after "tableServices"
-
try to put {} around MYKEY see if it works "INSERT INTO TESTAES (name,passwd) VALUES ('$name', AES_ENCRYPT('$password','{MYKEY}'))"
-
what is sum of column means? can u provide your own calculation? maybe we misunderstood you
-
Basic Question - Time left till date Unix TimeStamp wont work?
greatstar00 replied to sillyman's topic in PHP Coding Help
as you said, time left not the date, they are different you should say, 10months 20 days 20 hours not NOV 20, 1970 (nor March 26, 2010) so, you have to define your own function floor($difference /86400) . ' days '. floor(($difference % 86400)/3600). ' hours '. floor((($difference % 86400)%3600)/60) . ' minutes '. floor(((($difference % 86400)%3600)%60)) . ' seconds.' <?php //Current Server Time in Unix TimeStamp $today = date(U); echo "Current Server Time ".$today; echo "<br />"; //February 10, 2011, 12:00 am in Unix TimeStamp $target = (1297296000) ; echo $target; echo "<br />"; //echo date('F j, Y, g:i a',$target); //echo "<br />"; //Compare both timestamps $difference =($target-$today) ; echo $difference; echo "<br />"; //Covert time into more readable format //echo date('F j, Y, g:i a',$difference).'<br />'; echo floor($difference / 86400) . ' days '. floor(($difference % 86400)/3600). ' hours '. floor((($difference % 86400)%3600)/60) . ' minutes '. (((($difference % 86400)%3600)%60)) . ' seconds.'; you can check this too http://www.php.net/manual/en/function.date-diff.php -
if you want to test out those command on your computer go start, run, type "cmd"(without quotes) and on the dos window, type those command u like they are the same in $cmd of system("$cmd") but if u want to execute a program, your php will hang, because no result will produce, and php keeps waiting it
-
if you experience mysql synstax error like your have an error around ...................... near " something limited 1" do this $sql="$yoursql"; echo $sql; to check whether u have the proper value in the mysql query
-
as prometheos said, $arr, or $_GET['select2[]'], both of these are array if u dont know what is array, read http://php.net/manual/en/language.types.array.php so, u access $arr[0] or $arr[0] $arr= $_GET['select2[]']; $to=$arr[0]; NOT the following $to = $arr <<< WRONG!!!!!!!!!!!!!!!!!!!!!!!!!!!! in the wrong case, u get this $arr= array('something', 'something1', 'something'); in the right case u get $arr='something';
-
so, reverse the stuff change ORDER BY in SQL query string to: ORDER BY divisionCode, date
-
not "you have made an error" it should be "The server encountered an error" cause not all error is made by users. anyway, u cant handle syntax error like u mis typed a semicolon read this http://www.php.net/manual/en/function.set-error-handler.php
-
not "you have made an error" it should be "The server encountered an error" cause not all error is made by users. read this http://www.php.net/manual/en/function.set-error-handler.php
-
did u tried to use if (isset($name)) echo "yes"; else echo "no"; if (empty$name)) echo "eyes"; else echo "eno";
-
for this inner loop for ($j = 1; $j < 100000; ++$j) { if ($arr['val1'] > $a_1 and $arr['val1'] < $a_2 and $arr['val2'] > $b_1 and $arr['val2'] < $b_2) $x++; } why dont u just do $x=x+100, 000 // since u dont use J, and the if statement is always the same for 100000 times
-
that is the same thing theoretically
-
27 is mysql resource, not line number line #= 1 which means somewhere in the mysql query try to print the query out the part select avg(customer_id) ...............
-
or page.php?price_range[]=1-10&price_range[]=11-20
-
it is because u didnt close the }, before using else
-
Is it possible to reload a page without using headers
greatstar00 replied to TeddyKiller's topic in PHP Coding Help
when you try to output, store them into a variable then at the last line, just echo that variable (this wont make u send anything before the header, just use 1 <?php ?>) -
use mysql session then create a mysql table, named sessin when someone open a session, store to the mysql database (set timestamp) when certain time, clean the sessions then u can achieve it across domain, even across server session choose a mysql server that u can connect use a ip, or domain
-
folder "." is go back 1 folder back, like u are at c:\windows\system32, it will go back to c:\windows folder ".." is go back to root, i think, so, u will be at c:\ after u clicked it most files has extensions, so, your way just strip many files out too
-
so, u want to change to this? if $session = steven $sql = "SELECT id, steven, friendwith userlevel FROM friends ORDER BY id DESC,id LIMIT $offset, $rowsperpage"; if this case, it is not possible if u dont have the column named steven, u dont want to do this i suggest adding a where clause
-
isnt it suppose to be "checked"? like this echo '<input type="checkbox" name='ch1' checked='true' />'; echo '<input type="checkbox" name='ch1' checked='true' />'; echo '<input type="checkbox" name='ch1' checked='true' />'; echo '<input type="checkbox" name='ch1' checked='true' />';
-
just do this $remainder=$currentYear MOD 4 if ($remainder==0) echo 'Leap year'; else echo 'NOT Leap year';