1

Can you change excel sheet and make it importable into mysql tables?

Yes, it can be done. You can convert it to CSV and the use fgetcsv() and prepared statements. Search for PHPExcel or similar. If you use MariaDB, a MySQL fork, then you can use the ODBC connect engine to attach the excel file to a table and run a query to insert the rows into the destination table, see:

0

I got a message back from the provider and it's indeed not possible to edit the php,ini file because it's not only used by mine hosting package also by others. That kind of sucks!

Indeed, it sucks :| Not considering that they could use pools to provide separated resources and configuration files for each client.

I will ask if I can create a custom php.ini file in my own dcucment root to override settings.

Either that or my first suggestion: through prepended scripts, which should work for directives that can be applied at runtime, see:

0

Do you mean with a dedicated interface a thing like cPanel?

Yes. Sometimes you can edit configuration files only through these forms. You can, also, try to write a custom php.ini file and save it into the document root, success however depends on hosting configuration: if it is allowed then it will override the defaults.

0

Hi!

Are you using PHP-FPM? In such cases the PHP engine can be located into another server and accessed through an IP address. The address is configured in the web server config files and the php.ini file is in the remote server. You can probably use ini_set() by including a script in top of the others. Through .htaccess this is done like this:

php_value auto_prepend_file "/path/to/iniset.php"

Otherwise in PHP:

require "/path/to/iniset.php";

I would also check with hosting documentation to see if you can set the directives through a dedicated interface.

0

The loop is not executing the insert query, because the statement is executed at line 13. So only the last will be inserted. The insert can fail for different reasons:

  • $id does not increment through the loops, i.e. with: $i++;
  • when you execute the form again, $id will start from zero and if column ref is a primary key, it will generate an error for duplicate entry

It is better to use auto_increment on MySQL side and remove the column from the insert statement. The loop, by itself, seems fine, but the error refers to line 24, here there are only 14 lines: do you have other loops in the add script?

1

// EDIT

In addition to rproffitt's: contents, in the MS knowledge board, are loaded through Javascript, file_get_contents() won't load them, you need a rendering engine (like browsers do) to run your scripts. So you need something like PhantomJS: http://phantomjs.org/

Few months ago I posted an usage example here:

Which generates a screenshot of the page. The discussion was about testing the existence of a page with an HEAD request, which MS drops, and on success perform a GET request.

1

Hi,

if you can edit the main php.ini file, change the option to on:

allow_url_fopen=on

then reload the phpinfo page to see if it applied. The location of the file is defined in the Configuration File (php.ini) Path of the phpinfo view. If you cannot edit the main php.ini, you can try to create a new php.ini file in the document root. And just add the options you want to change. The Loaded Configuration File field of the phpinfo view should show if the new file is loaded.

Note: some times, the configuration (of PHP or of the web server) does not allow to override the settings through custom php.ini files, so you may need to contact your hosting support to make changes.

For more info, see the HOST and PATH directives:

0

Thanx for your reply but I am still facing the same issue.
Can't store values of text fields in variables

You're welcome, but I was not suggesting a fix, I suggested you to run those functions in order to see if there are errors in your database connection, in the query syntax or if it rises a duplicate entry error (due to unique columns). If you don't get any errors, then check if the $_POST array is populated and if it gets the correct index names:

print_r($_POST);
0

Hi, add error checks before and after the query:

if($conn->connect_errno)
    die(sprintf("CONNECT ERROR: %s: %s", $conn->connect_errno, $conn->connect_error));

$result = mysqli_query($conn, $sql);

if($conn->errno)
    die(sprintf("ERROR: %s [%s]: %s", $conn->errno, $conn->sqlstate, $conn->error));

And see if you get any useful input.

1

Hi,

you are missing a comma between these two columns, in the update statement:

work_carry = '$work_carry' demage_found = '$demage_found'

Then edit_customer_detail is not set by the form which, however, is okay if this is set by a previous step and carried through GET.