Search found 365 matches

by freshnet
Fri Mar 16, 2018 4:49 pm
Forum: PHP General
Topic: Output external program
Replies: 2
Views: 529

Re: Output external program

Hi!

You need to provide more details on exactly what you want to do, why, and what you've tried so far (with code) if you want a useful response.

thanks
by freshnet
Fri Mar 16, 2018 4:47 pm
Forum: PHP General
Topic: Possible to grab SSID/Network Name of wireless router via php?
Replies: 1
Views: 374

Re: Possible to grab SSID/Network Name of wireless router via php?

No this isn't possible. I'm fairly certain that what SSID or router you are using to connect is visible only to the OS.
by freshnet
Sat Jan 20, 2018 9:07 am
Forum: PHP coding => General
Topic: LDAP PHP
Replies: 1
Views: 281

Re: LDAP PHP

No it's not. See https://stackoverflow.com/questions/148 ... a-php-ldap this answer on SO. You can probably run a shell script to get at least some of this done though.
by freshnet
Sat Jan 20, 2018 9:06 am
Forum: PHP coding => General
Topic: Dynamic data showing
Replies: 1
Views: 247

Re: Dynamic data showing

Please read the forum stickies about asking questions (and my signature) and format your question as noted there, or you'll not get any responses.
by freshnet
Sat Jan 20, 2018 9:02 am
Forum: PHP coding => General
Topic: mysql sum totals without using with rollup
Replies: 1
Views: 290

Re: mysql sum totals without using with rollup

A couple of quick thoughts 1. That error references the WHERE clause, however your posted query doesn't have a WHERE clause. So either you're looking at the wrong error, or you've not posted the actual query you're using 2. The first query works, however you should remove the i.id from the SELECT as...
by freshnet
Sat Jan 20, 2018 8:54 am
Forum: PHP coding => General
Topic: Cannot get mysqldump to run from localhost
Replies: 0
Views: 474

Cannot get mysqldump to run from localhost

[back after some time off!] On my production websites, I have some code that runs via a cron job to backup the databases. This is working fine, and I want to set up the same thing (but more complex) on my own machine. The exec command that I have is fine, because when I echo it back and run it from ...
by freshnet
Sun Feb 05, 2017 6:48 am
Forum: PHP coding => General
Topic: Is there any PHP function similar to "FORECAST.ETS()" in Excel ?
Replies: 1
Views: 781

Re: Is there any PHP function similar to "FORECAST.ETS()" in Excel ?

Forecast uses exponential smoothing, which is not built into PHP. You may be able to find an alternative function as a snippet, but I'm not aware of one.
by freshnet
Wed Feb 01, 2017 1:00 pm
Forum: mySQL & php coding
Topic: My Problem with dropdownlist in mysql,php
Replies: 11
Views: 2944

Re: My Problem with dropdownlist in mysql,php

Also just noticed you have

Code: Select all

mysql_insert_id
instead of

Code: Select all

mysqli_insert_id
by freshnet
Wed Feb 01, 2017 12:58 pm
Forum: mySQL & php coding
Topic: My Problem with dropdownlist in mysql,php
Replies: 11
Views: 2944

Re: My Problem with dropdownlist in mysql,php

Ok as I said, I don't know too much about SPs. Your get roles SP could just be a query right? I don't see any reason to write a procedure to just run a single select query. As for the other SP, here is how I do these things. First I make the required fields required in html, and also check the PHP f...
by freshnet
Tue Jan 31, 2017 8:15 am
Forum: PHP coding => General
Topic: Image Upload failure since website migrated
Replies: 9
Views: 1932

Re: Image Upload failure since website migrated

Are you looking for a person, or a hosting provider, or an application to help you write PHP code? If you want to hire someone to write your code, I suggest you try something like www.upwork.com.
by freshnet
Mon Jan 30, 2017 5:39 pm
Forum: PHP coding => General
Topic: SQL to Array
Replies: 5
Views: 1199

Re: SQL to Array

I agree this is better, I'd forgotten about correlated subqueries!
by freshnet
Fri Jan 27, 2017 6:27 pm
Forum: PHP coding => General
Topic: Image Upload failure since website migrated
Replies: 9
Views: 1932

Re: Image Upload failure since website migrated

Yikes. You really need to upgrade PHP. 5.2 has not been supported since 2011 http://php.net/eol.php . If your hosting provider supports a newer version you should strongly consider upgrading. There are other things that could be different than just the version that might prevent your code from worki...
by freshnet
Fri Jan 27, 2017 6:22 pm
Forum: mySQL & php coding
Topic: My Problem with dropdownlist in mysql,php
Replies: 11
Views: 2944

Re: My Problem with dropdownlist in mysql,php

I'm not an SP expert, but aren't you calling your SP without any parameters?
by freshnet
Thu Jan 26, 2017 8:00 pm
Forum: mySQL & php coding
Topic: I'm unable to insert a record/entry using PDO. Could any one help?
Replies: 2
Views: 879

Re: I'm unable to insert a record/entry using PDO. Could any one help?

Your code looks fine to me, can you give an example of what values each variable has and what you see on screen? You can find information on data types here https://dev.mysql.com/doc/refman/5.7/en/data-types.html
by freshnet
Thu Jan 26, 2017 7:52 pm
Forum: mySQL & php coding
Topic: Notice: Undefined offset: 0 in session
Replies: 1
Views: 807

Re: Notice: Undefined offset: 0 in session

[0] will not work with $_SESSION unless it's explicitly set. In your code it's not set, so you get an undefined offset. You can only reference an element of the $_SESSION global array by the same key you gave it.

Code: Select all

echo $_SESSION['username'];
by freshnet
Thu Jan 26, 2017 7:49 pm
Forum: mySQL & php coding
Topic: My function wont update mysql entry
Replies: 4
Views: 1202

Re: My function wont update mysql entry

If your $user variable is a string, you need single quotes around it. Having said that, the mysql extension is deprecated. You should upgrade to mysqli minimum, ideally use PDO which will allow you (if you feel it's necessary) to catch exceptions.
by freshnet
Thu Jan 26, 2017 7:42 pm
Forum: mySQL & php coding
Topic: My Problem with dropdownlist in mysql,php
Replies: 11
Views: 2944

Re: My Problem with dropdownlist in mysql,php

Ah didn't spot that, thanks for posting your solution!
by freshnet
Thu Jan 26, 2017 7:40 pm
Forum: PHP coding => General
Topic: help with a bible search script
Replies: 5
Views: 1014

Re: help with a bible search script

You are coming across as a little hostile. This is a forum for people to get (free) assistance with coding, please be grateful for that. If you have a specific question, please provide the code or algorithm that you have so far, and where you're running into problems. If you can't do that, you're un...
by freshnet
Thu Jan 26, 2017 11:02 am
Forum: PHP coding => General
Topic: SQL to Array
Replies: 5
Views: 1199

Re: SQL to Array

I'm not sure what you're asking exactly in terms of the array, but yes you can easily do something like $playerDataArray['id'] = x; //run a query to get the deaths $playerDataArray['deaths'] = x; //run a query to get the kills $playerDataArray['kills'] = x; As an alternative, have you considered usi...
by freshnet
Thu Jan 26, 2017 10:49 am
Forum: PHP coding => General
Topic: Change ORDER BY when a row's value has 0?
Replies: 2
Views: 879

Re: Change ORDER BY when a row's value has 0?

Just create a virtual column and order by that. Something like this should work. Alternatively, why not just order by rank then recentactdate for everyone? Right now those rows will just be in random order within ranks. SELECT rank , CASE WHEN rank = 0 THEN RecentActDate ELSE NULL END rank2 FROM acc...
by freshnet
Thu Jan 26, 2017 10:44 am
Forum: PHP coding => General
Topic: Image Upload failure since website migrated
Replies: 9
Views: 1932

Re: Image Upload failure since website migrated

What makes you think the PHP version has changed? If you create a file with the below code and execute it, is the version what you expect? <?php echo phpinfo(); ?> What shows in the error logs for the image upload? Finally, if the PHP version has changed, what makes you think this is causing the pro...
by freshnet
Thu Jan 26, 2017 9:50 am
Forum: PHP coding => General
Topic: Request help with form posting. I can only post part of a form.
Replies: 6
Views: 1396

Re: Request help with form posting. I can only post part of a form.

The post part of your code is fine. The PDO part however is incorrect. First, you are mixing prepared and non-prepared query code. Second, you are trying to execute a query using a string variable as an object. Neither of these will work. You also have some other errors such as comparing your 'if' s...
by freshnet
Thu Jan 19, 2017 5:18 am
Forum: mySQL & php coding
Topic: Can I request guidance with PDO Database?
Replies: 6
Views: 1448

Re: Can I request guidance with PDO Database?

One more thing I noticed - if you're going to use variables directly in your queries (which I don't recommend), you need to put them in single quotes. An easier solution (in my opinion) is to use binds, because then you don't have to remember the quotes. This is what you should have "$sql=UPDATE php...
by freshnet
Mon Jan 16, 2017 3:16 pm
Forum: mySQL & php coding
Topic: Create and Maintain a single/reusable connection to database with PDO
Replies: 3
Views: 989

Re: Create and Maintain a single/reusable connection to database with PDO

Just curious, why have you got prepare emulation disabled? The only reason I can think of to do that is if you have to run the same query lots of times within the same script.
by freshnet
Mon Jan 16, 2017 10:04 am
Forum: mySQL & php coding
Topic: Can I request guidance with PDO Database?
Replies: 6
Views: 1448

Re: Can I request guidance with PDO Database?

Actually, that looks more like the page isn't serving php at all, since it's displaying your complete code. test it with

Code: Select all

<?php

phpinfo();
If that doesn't work, the problem is php and not PDO at all.