-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
You might try adding this to get your script to show possible problems error_reporting(E_ALL); ini_set('display_errors', '1'); And if setting max execution time to 0 is meant to disable any controls over how long your script runs, I would change it. Do you really want to tie up your server with a problem script or some very long running time? Set it to 5 seconds or even 10, but certainly not infinity (0).
-
I and apparently everyone else is totally confused by your introduction. Can you re-word it so it makes sense? First you say you the "input.php" script that allows a user to upload a file. Then you say the user hits a button and something called "import.php" process a website. Well - what is it you want help with? If re-read your paragraph it might give you an idea of how confusing your post really is. Waiting for some clarity.
-
adding multiple rows into databse incrementing one field.
ginerjm replied to nook6's topic in PHP Coding Help
And I learn something new once again! -
adding multiple rows into databse incrementing one field.
ginerjm replied to nook6's topic in PHP Coding Help
But - he gave you the solution. My idea was to use separate tables because I didn't realize one could have multiple auto-inc fields. Since Guru Barand (!) knows that one can in fact do that , he has GIVEN you the proper solution. Thank him for that code AFTER you apologize. And then remember to tell people your entire situation before asking for help next time. PS - you don't really have to repeat every post in your next post. Just a lot of wasted space. -
adding multiple rows into databse incrementing one field.
ginerjm replied to nook6's topic in PHP Coding Help
You could use one database but have separate tables for each raffle. Not the best approach but if you want to use auto-inc, then that would be one method. Have a radio button on your entry form to choose which raffle you are selling for at the moment which you would then translate to the correct table name in your script. -
I would upload the images and resize them to a separate folder and use THOSE for my web page. Perhaps a click response on a reduced one could take the user to the full size one on a separate page? This eliminates the need to repeatedly re-size images for every user.
-
If your numbers are going to be 1-5 then you might try this: // assume that $i is the number 3 $idx = $i-1 echo "Name is: ".$name[$idx];
-
If they are still looking for a solution.... It is 3 months old afterall.
-
The braces are required when embedding complex variable names (an array element) inside other things. Without them you would get a syntax error. You could use concatenation (dots) to avoid this but with the braces you can skip the concatenating and just compose one contiguous string here. The thing I wanted you to note was the quotes on the array indices. A Key thing!
- 9 replies
-
- 1
-
- php
- target attribute
-
(and 1 more)
Tagged with:
-
how to open and add after multiple occurence of a line
ginerjm replied to hungryfrank's topic in PHP Coding Help
So - by now you should have managed to make these 2 changes manually. So - what's the problem? -
You should study Barand's code carefully since it corrects some syntax errors that you were making as well as solving your problem. Array indices need to be in quotes unless they are php vars themselves.
- 9 replies
-
- php
- target attribute
-
(and 1 more)
Tagged with:
-
how to open and add after multiple occurence of a line
ginerjm replied to hungryfrank's topic in PHP Coding Help
I think I know what you are trying to do and that is to modify a block of code that exists in several files. So - my suggestion is to stop and re-think your actions here. Why not alter all those lines to one call to a function passing in a variable? Then write a stand-alone module that contains this function and have it do the work. This way if you need to change this once again, you would only have to worry about one existence of this code. -
NO I didn't look at the code. People who post reams of code without thought for the people unfamiliar with the thoughts, ideas and processes being used and expect it to be resolved for them just aren't thinking. If you want help try and make it possible for others to help you - that is my point. Do some debugging; isolate the location of the problem and dig into it and only then post it and ask for help. PS - judging from the timbre of your own post I have to wonder how miserable you must be to write that. Tsk, tsk....
-
PHP Warning: mysqli_select_db() expects exactly 2 parameters, 1 given
ginerjm replied to shimabuku's topic in PHP Coding Help
Needing 2 parms means that your connect didn't provide the proper result for the select_db call. Figure out first why your connection fails. Usually a good thing to check whenever you open a db connection. if ($mysqli->connect_errno) { echo "Connect failed, error is: " . $mysqli->connect_error); exit(); } -
And you want US to write your php script from this stuff? I Don't Think So.
-
You are making a tutorial? Really? And you don't understand what is wrong with the quote of yours above? The Globals array contains all defined variables of your current session. Even your current running process. So - if you have defined something such as $name that is defined in the Globals array. Thus if you reference $name it already IS known as $GLOBALS['name']. Of course I don't understand your syntax when you mentioned "value(name)" so my assumption of defining a var called $name may be totally wrong. Perhaps you could clarify what you meant by the use of "value(name)"? And as others have said. $GLOBALS is not something that anyone uses. It's just not. That and the $_REQUEST array are not preferred even tho they still exist. If you want to reference something, do it properly, i.e., look for php vars such as $name or $x or $arr, blah,blah,blah or $_POST or $_GET instead of $_REQUEST. And if you want to make a local script var known inside one of your functions, either pass it in as an argument or declare it as global using the global construct inside each function that you want it known in.
-
I know it sounds like a fun project to emulate something that already exists. But - just exactly why do you think it necessary? There is already a $_SESSION array (RTFM) and the ability to make specific local vars global for your entire script (see 'global') . So what design of yours is going to need your own new version of this? Besides - good programming practice does not include making everything globally available.
-
Specifying an index without quotes makes php do a tedious evaluation of that unknown value and assuming that it is a constant of some kind. Definitely not the already-defined var name that you have in mind. Indices need to be quoted string values or defined php vars (which don't need quotes).
-
I'm getting this error from a PDO connection
ginerjm replied to Michael_Baxter's topic in PHP Coding Help
Well, GW gave you an answer that had 2 options. Obviously the second one is the one you need to pursue. -
Don’t know how to get values from stored procedure
ginerjm replied to narutofan's topic in PHP Coding Help
Barand - such patience.... -
Just show the other guys what your JS code is (and not all that html!) and ask them how to make it work for you.
-
Maybe you should be posting on the JS forum then? Or ensure that this code is indeed gets executed every time?
-
Don’t know how to get values from stored procedure
ginerjm replied to narutofan's topic in PHP Coding Help
Your tables have some problems for joined queries? That sure sounds like a poor design. Perhaps addressing that would solve not only this problem but a lot of future ones? And then it would allow you to collect all of your data in one query results set and that would make your output algorithm easier. And please don't say that you can't make time to fix this problem or that you only want to get this one thing working. You have done something wrong and for people here to help you work around it would not only be a bad use of their time, it would encourage you to continue to do things in less than appropriate ways. You have made a misstep here and you should step back and learn from it and gain the knowledge that comes with that. -
Way too much spaghetti code to wade thru..... Let's start here: How are you "saving" this info that is coming up incorrect? Obviously that is the problem. Old data is being kept and re-used when you don't want it to.