Equation Help - Half Life.
I am looking for some help setting up a half life equation in PHP. Does anyone have a prerolled function they would care to share?
View Complete Forum Thread with Replies
Related Forum Messages:
PDO Transactions Life Span
Do transactions automatically commit or rollback after a specific period of time? does mySQL close its connection after a specific time? or maybe PHP closes the connection? I've got quite a semi-complicated script that takes about 85 seconds to execute usually. This is due to it accessing remote files etc as that just adds time. Code:
View Replies !
Session Id In A Long Life Cookie
Okay, my session's cookie is by default set to destroy on session closure. I want to make this cookie last 30 days. the only way I came up with is to put: session_set_cookie_params() before every time I say session_start(). Is there an easier way to do this? something that I can do only once?
View Replies !
Real Life Examples Of Mysql+session_set_save_handler
In my test setup using my own session handlers with session_set_save_handler and mysql, the session handler opens and close mysql connections. But what if my page also requires some mysql queries? Should I open a new connection or use the already opened one (opened by the session handler)? I have made it a good practice to close a connection after a query but if I do it with only connection open no session data will be written to my mysql table. I have seen some scripts using persistent connections but are not sure what would be the best for a real world environment.
View Replies !
Half A Function
How can I make a half function half variable, so that, like, I set it to the PHP code I want it to use, and put in my code like a function, except that all of the variables stuff act like I am just putting in the code, so that I don't have to declare all of the variables as global and stuff like that? Basically I just want to cut down on my code size so that I don't have to copy and paste the same piece of code over and over, instead of making it into a function which messes with the way variables work and stuff.
View Replies !
Equation In SQL
This query sums the score of all the points a player gets for each tournament and then produces the list. The SQL works in Access, but doesn't work when I move it to my website using php and mysql. Code:
View Replies !
Equation
The following equation gives me different results depending on the server it is run on: -480006878 ^ (((-1592259782 + -632551035) ^ 86519011) + 3744833421) The correct result is -1092453685. However, I am getting -2025954990 on another server. This equation is used in a decryption algorithm so it is critical that it produce the same results. Even when I pulled those numbers out of the variables in the code and ran them by themselves I still get different results depending on the server so I know it is not the code at fault. print('<div style="border:1px solid green">'.(-480006878 ^ (((-1592259782 + -632551035) ^ 86519011) + 3744833421))."</div>");
View Replies !
2nd Half Of String Disappearing
I'm passing strings from one page to another. Basically, users vote for their top 10, and their votes are displayed on the next page. The things they vote for are school names. Everything is ok, if they do the standard voting. However, if the users can't find an option they like, they can vote for "OTHER". Then they are taken to an intermediate page, where their picks are displayed except their is a text box for them to fill in for the OTHER school. Everything on this form is displayed correctly. However, once they submit this form, when they go to the final page with all of their picks displayed anyschools that had two word names, ie Lousiana State are now only displayed as one word ie Lousiana. This baffles me because on the page previously, it says Louisiana State correctly. All I'm doing is then passing this variable as a hidden type to the final page. Does hidden truncate second words for some reason? I have magic quotes off.
View Replies !
For Loops With Equation
How would I make a script using for loops to figure out this equation: EDCBA x 4 = ABCDE Each letter represents a number and i need to know what ABCDE is. Anyone know?
View Replies !
Query & Equation
how to query the database and retrieve the number of rows. What i have no idea about is. Getting the field (amount) for example, from each row And make it possible so that i can add the values together. example These would be from the field named amount. row1 = 22 row2 = 23 row3 = 36 so that i'm left with the equation -> 81 .
View Replies !
Mathematics Equation
in my database i have a field. init_price and the field is a FLOAT 10,2. couple of recordsi have in there look like this. 10.50 52.00 (they are prices) what i need to do is work out GST (Tax) on them so. 10.50 * .10 = 1.05 10.50 + 1.05 = 11.55 i then need to print that 11.55. how do i do this. i tried $init_price = $line [init_price]; $my = (int)($init_price * .10); echo $my; but it comes out like this. 11.000000 ment to be 1.05
View Replies !
Equation Format
i've got this from a javascript; P = ((A*R)/12) * (1/(1-(Math.pow(1/(1+R),T)))); which i put into php as; PHP Code: $P= (($A*$R)/12) * (1/(1-(Math.pow(1/(1+$R),$T)))); but i get different answers! i know the first one is right.
View Replies !
Ms And Odbc - Only Returns Half The Rows
I'm attempting to fetch all the data from an MS Access database, but every time I try with any query it only returns every second row.. I could rows numbered from 1 to 4000 and it would return exactly 2000 rows.. I would get rows 2, 4, 6, 8, 10 ,etc.. Code:
View Replies !
Maths :: Algebraic Equation
Is there a way to do this equation: x+2=x(2)+1 and get x=3. Or know of a site taht has a class or function that can do this? This is not really for use on a site but it would be cool to see.
View Replies !
Calculating An Equation Stored In A String
I am making a simple web-based interface that will allow users to add shapes into a DB. This will involve uploading a shape description, a jpeg of the shape and an equation for the area of the shape. It doesn't have to be too dynamic so i've kept the equation as a standard format, using x0 -> xn as the variables for the equation. For example, the equation for the area of a square would be x0 * x0 ( length * length ) as there is only one variable for deriving the area of a square. A rectangle would be x0 * x1 ( length * height ) etc. I then have code that reads the equation and counts how many variables, assigns names to these variables etc. This part is all fine. When the user selects a rectangle and enters 2 as variable1 and 3 as variable2, the code will retrieve x0*x1 as the rectangle's equation, replace the x0 with 2 and x1 with 3, using str_replace() function. This all works fine. So, I'm left with a string stored under a variable with value 2*3 The only problem is that i don't know how to calculate that string. I don't know how i would return a value of 6. Will it not always return the value as "2*3" because it is a string?!?
View Replies !
Math Equation Results In MySQL
I am trying to get the results of a SUM query on a table that shows totals of some items sold. The items are broken down into item_price, quantity, and discount_percent. I am multiplying the SUM of this equation by the SUM of a quantity equation. Here is what I want my SQL query to do, and it does not act like it is correct. Any pointers or help would be greatly appreciated. Here is my SELECT: Code:
View Replies !
Form Problem, Webpage Will Only Load Half The Form Fields
Im using windows xp, php,mysql, and apache. when i run this code on my computer everything works fine. But when other people try to access my website from their computers, when they click on the link to go to this page, only half the form fields load.everything after country just stops. Code:
View Replies !
PHP Seems To Work Half The Time, Phpinfo() Doesn't Work
I just updated from a phptriad installation of apache/php/mysql to manual installations of them, all the most current ones. When I installed apache and php, things were fine. phpinfo loaded. After I installed mysql, things started messing up. I can connect to mysql so that seemed to go fine. But phpinfo wouldn't list MySQL info. So, I noticed I had the path to PHP in my httpd.conf wrong, I fixed it, restarted and thats when it all started. I added the "php extension" line , enabled php_mysql.dll module, as well as putting libmysql.dll into my windows folder. Restarted the computer, and still problems. What happens exactly is, if I go to my phpinfo.php page which has a simple phpinfo(); line...it doesn't show anything. If I View Source, I actually see the php code in notepad. <? phpinfo(); ?>On other pages it prints some of the php code on screen. But on a few other pages, such as a page that creates and image via imagecreate()...it works.
View Replies !
|