-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Very difficult to help when all we are getting is a couple pieces of some supposed code. How about showing us the full lines involved? Not the whole script, but the parts you are mentioning.
-
php code for connecting to mysql database
ginerjm replied to mrchickenkiev's topic in PHP Coding Help
There are so many resources available to you if you would JUST do a google search. Yet you have persisted in floundering around trying to explain all kinds of different issues here. Aren't you tired yet? Do Some Work and look up some examples. Really.- 20 replies
-
Actually the sample provided in the prev post is a little off. It should read: function rand_string(&$confide) in the header in order to return the value as the creator designed it. More importantly though - the one-line function that you want is really meaningless and less efficient than just executing the one-line inline in your code. Why would you want to make a function out a simple statement that has no variable in it? As for making anything a function - functions are great when you have a set of code that either: a) gets used repeatedly or b) gets used repeatedly with different variables involved that change the result Looking at the code you presented for your second function, I'm wondering how many times you are going to call it. But - if you really want to do it, simple wrap all the code in a set of curly braces with a line on top of that saying: function (myfunctionname)(my vars, my vars....) where 'my vars' are values you send in to the function to be used in whatever task it is performing for you. If you have none, then you won't need to include these in the function header. The manual covers writing your own functions. You should look it up.
-
Your query is flawed to begin with. Then you don't show us how you are executing the query. Would love to help but we need to see some more I think.
-
Lets Play Cards.. Help figuring out what is in your hand
ginerjm replied to webdevdea's topic in PHP Coding Help
And what section should we be focusing on? Has your own error-checking pointed you to any line numbers? Help us to help you. -
Need help with multiple PDO queries (creating web statistic)
ginerjm replied to tomailas's topic in PHP Coding Help
Not to scare you off or tell you what to do, but why would you choose to begin your php development with classes and their compications? If you're trying to learn php, simply begin with your idea, layout your work plan, develop some needed functions and put it together. IMHO, classes are not everyday things, at least not at the beginning of your learning cycle. Plus - classes are great when you have plans to implement the same actions repeatedly, as in a large project/application, but not worth the effort for a single usage. At least not until you become proficient at writing them. As for your example - it is rather dis-joint. Do you have error checking turned on to pick up any errors that may have occurred in the class functions? -
What inner loop? If you are positive that is the area with a problem, why give us so much to search thru? PS - your html could seriously use some CSS to clean it up! Do you really think you have to write all those style attributes into every <td> tag??
-
If I understand the previous poster - If you want to display these images in your web page, then you have to store them in the web-accessible tree. The security issue is that they are then reachable and you may not want that. Setting the .htaccess file can control that, so he is telling you to work on that side of things. You'll have to do some googling on htaccess files.
-
Lets Play Cards.. Help figuring out what is in your hand
ginerjm replied to webdevdea's topic in PHP Coding Help
Way too hard to decipher not knowing what your whole app looks like. How about telling us what section is not right and what you ARE getting that is wrong? -
HTH - don't forget to mark this as answered.
-
I get An error when trying to delete from Database in my Plugin
ginerjm replied to Jenksuy's topic in PHP Coding Help
Right off the top - you never set a value for $i which you then use to set $del_id which is in your where clause. I imagine your query looks like "DELETE from job_details where id = "; -
Assuming that you "generate" button is a submit, make sure your form uses "method='GET'" That will generate the url you seek, where your username input tag has a name of 'u' and your size tag a name of 's'.
-
As TOA says - you should NOT be posting the image itself to a table. Assign a folder(s) for your image(s) and then store the path/name in the table. Standard procedure.
-
When you build the first page, set action to the script doing that build. Then when the page is submitted to that script, capture the checkbox choice. If you have one, then do this: if ($checkbox_value == "platform") $url='platform.php'; if ($checkbox_value == 'playlist') $url = 'playlist.php'; header("Location: $url"); The last line will take you to your script.
-
Try strtotime function to convert your varchar to a true "time" value if that helps.
-
Is this some new form of html where you don't need an action= attribute on your <form>? Also - how are you switching from php mode to html mode and back? I don't see any <? ?> tags.
-
As Psycho says - it's in the process, not the query. His method is the way to go, as I also suggested.
-
help regarding products being inserted to database
ginerjm replied to hance2105's topic in PHP Coding Help
It's a simple table query. Usually people post their attempt at the code here and tell us what is wrong and we point them in the right direction. Take a stab at it. -
First this is not a problem with query results, but with a query design. You want to join x number of records to just one record which is a pretty tough task. Tell me, are you just going to take the query results and generate a web page? If so, you can handle the 7 records as you loop thru them, keeping track of when you reach a new product and displaying the 'header' info for that product, but only showing the image name/image as you hit each successive record. Does that make sense?
-
This is all do-able, although I don't know what the apache reference means. Google can help you. Try it.
-
Parse error: syntax error, unexpected P_LNUMBER
ginerjm replied to BTIconnect's topic in PHP Coding Help
line 64 is the key. You need to load your code in a php editor/ide so that you are sure of what line 64 is. I still don't like the colons after your if conditions. There should be no punctuation other than a curly brace there. -
Parse error: syntax error, unexpected P_LNUMBER
ginerjm replied to BTIconnect's topic in PHP Coding Help
also - look at your default_image setting above line 64. That looks strange. Is the jpg file spec supposed to be an argument of the function preceding it? -
Parse error: syntax error, unexpected P_LNUMBER
ginerjm replied to BTIconnect's topic in PHP Coding Help
Also - what is this character after the if condition? if ( ! function_exists( 'themezee_enqueue_scripts' ) ): Not correct AFAIK. -
Your comment says that your query statement gives error if it fails. But you don't show an error message with simply 'or die()'. Try adding some text to the die and see if it says something. Then add some other echos in the following code to check your progress so you can see how far you are getting and debug your problem. Also - turn on error checking. It will help you debug some other errors. For ex., you have an if statement at the top with a '|' in it, which is not a proper logical connector. ('OR' is usually '||')
-
php code for connecting to mysql database
ginerjm replied to mrchickenkiev's topic in PHP Coding Help
You should really read a short book on coding in php. A lot of understanding to be gained there.- 20 replies