-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
If the client knows it's happening, sure. Probably either explicitly mentioned in the contract, or done after the fact with some sort of agreement. Paperwork. Otherwise definitely not.
-
It didn't do what prior to what install? It almost sounds like you're saying you had PHP working before you installed Apache and PHP... If you're using php-fpm (which you generally should be) then you need to tell Apache that it should run .php files through the service. Check the online documentation for how. If you're using mod_php then I'm pretty sure you haven't actually installed it. Beyond that, it depends what operating system you're using.
-
Sending to mySQL database, but nothing received
requinix replied to samanj's topic in PHP Coding Help
$patientname = | $_POST['patientname']; Why is there a pipe in here? When you check for data, are you looking at everything in the table? Or just running a SELECT query for the data you expect to see? -
Not entirely clear on the workflow here. For you to count leads, you have to receive them. As in they have to go through your service. Or you have to be able to access a source of data that has leads. How does that fit into how leads work in the industry now?
-
How to extract a given number of characters from a php variable
requinix replied to larry29936's topic in PHP Coding Help
basename() will not return the slash. You're obsessing about it perhaps a little bit too much. -
I don't know what's wrong with that code because you haven't described the sort of problem you're having with it. I don't see any library that explicitly mentions supporting Code 32, but it appears to be somewhat compatible with Code 39. You may be able to get a library to read those (which are much more common), and then convert the encoded value to Code 32 using an algorithm I don't know.
-
How to extract a given number of characters from a php variable
requinix replied to larry29936's topic in PHP Coding Help
Okay... I said that because the code you wrote was trying to remove the extension. Either basename() or pathinfo(). Either of them in a single function call will give you the value you need. Directly. You don't have to care about the slash. Please just read the documentation for one of them. -
How to extract a given number of characters from a php variable
requinix replied to larry29936's topic in PHP Coding Help
Oh, you don't want the extension either? Look at the documentation for pathinfo. The answer is there. One single function call is all it will take. -
How to extract a given number of characters from a php variable
requinix replied to larry29936's topic in PHP Coding Help
Actually the process needs to be: 1. Use basename -
Change SQL Selects based on if on desktop or phone/tablet ?
requinix replied to PatRoy's topic in PHP Coding Help
From what you're describing it sounds like the problem is the way those columns are displayed. Right? Which would make it a job for CSS. Right? Depending on your CSS framework, you can show and hide things depending on screen sizes... -
Then it doesn't matter what Apache is running as. Because Apache is not connecting to the database. php-fpm is. Set up a php-fpm pool specifically for you to use pgAdmin with - a pool separate from your normal one. It can run as the postgres user so that it has full access to the database. Then modify your Apache/virtualhost/whatever configuration so that it runs pgAdmin URLs through this dedicated pool. Ideally you'd have this as a completely separate virtualhost... Your regular pool will be with the michael user.
-
get data from two tables for specific ticket id and username
requinix replied to ianhaney's topic in MySQL Help
1. You're still putting a variable into the query. The user_name from the session. Make that be a parameter too. 2a. Your query is searching for a ticket_id that matches your $filename. 2b. You aren't checking if the query perhaps didn't return any results. 2c. Your query is returning the ticket_id, file_name, and user_name. In that order. You are only binding the one $filename, and in the first position. Which would be the ticket_id. Please, try spending more time learning about this. If you can't see the page I linked you then find another site on the internet that talks about how to do prepared statements with mysqli. -
get data from two tables for specific ticket id and username
requinix replied to ianhaney's topic in MySQL Help
Look at the example code from that page I linked you to. Do you see the question marks in the queries? Notice how it does not put variables into the queries directly? That's what you need to do: use a question mark in every place that you want a piece of data, then use bind_param() to fill in the values. In the first bit of code you're using fetch_assoc() to get rows of data. So the values you need will be in $row. PHP isn't creating variables for you because you didn't tell it to do that. In the second bit of code you're using bind_result() which will create variables. -
Almost. Are you using php-fpm or mod_php?
-
Do I have any idea how to "sending sms with whatsapp via PHP"? Yes.
-
get data from two tables for specific ticket id and username
requinix replied to ianhaney's topic in MySQL Help
It's why we're here. -
Not sure. Look in /var or /var/run for something appropriate. Based on the "connection refused" error message from earlier, you don't have one. I'm not sure what the "service" is. I would guess it's the name of the system service, but I'm not sure why pgAdmin would care about that. Anyway, don't worry about it for now.
-
get data from two tables for specific ticket id and username
requinix replied to ianhaney's topic in MySQL Help
No problem. The thing I linked has a few examples on how to set up a prepared statement, pass values into it, run the statement, and get the results back. -
get data from two tables for specific ticket id and username
requinix replied to ianhaney's topic in MySQL Help
user_name? Not sure where you're going with that, but my point is that by putting a $_GET value directly into your query, anyone can change the query to do whatever they want. Even to make it do Bad Things. What you need are prepared statements: you build a query with the structure that you want, using placeholders for where data needs to go, then you tell MySQL what data goes in those placeholders. Prepared statements actually have a few other benefits, but they don't apply much to this particular situation. -
get data from two tables for specific ticket id and username
requinix replied to ianhaney's topic in MySQL Help
Unfortunately for you, that's not the end of your problems. Question for you: what query would run if I were to visit your page, go into my browser's address bar, and change the ticket_id to be anything I wanted? For example, what if I changed it to 123+OR+ticket_id+=+456 -
When you're using prepared statements you pass the query string to prepare(). You don't use query() at all.
- 1 reply
-
- 1
-
Ah, I was reading pgAdmin 3 documentation. For the hostname, put the path to the socket file. Not all *nix systems are running an authentication system on port 113. You don't need to use it unless you have something special running there that provides some specific form of authentication - which I'm sure you don't.
-
Again: don't use 127.0.0.1 as the host. Remove the configuration entirely so it uses a socket. You know, like how MySQL connections often work.
-
It's not. You're effectively dropping all authentication.
-
Take a look at the authentication configuration for PostgreSQL. "local" connections are peer (system username), while the "host" connections from the local machine are ident (username and password). If you have a password set up for the michael user/role then this should work. But you shouldn't need one: remove the host from the pgAdmin configuration to connect by socket, keep the database and user (but you may want to switch back to postgres/postgres for those), drop the password, and I think drop either the username or role.