Code Monkey home page Code Monkey logo

Comments (7)

Logan1x avatar Logan1x commented on September 14, 2024

CC : @tomsik68

from docker-xampp.

Logan1x avatar Logan1x commented on September 14, 2024

Now that I am able to run the test PHP script. I went into my actual folder and tried to run that. It ran successfully but not able to fetch data.
I have simple webpage which taking form data and on clicking save button redirecting to reg.php file. But on http://localhost:41062/www/reg.php nothing opens.

from docker-xampp.

Logan1x avatar Logan1x commented on September 14, 2024

Here is the repo link, if you want to look at code. https://github.com/Logan1x/php-docker

from docker-xampp.

tomsik68 avatar tomsik68 commented on September 14, 2024

Hi, I cloned your repo, started your container like this docker run -p 41062:80 -it newtestwithnewcontainer. Then, I created record database and ran your sql script on it in phpmyadmin. This is what I see on localhost:41062.
image

Then, I tried to click the add new button. And I got the following php error:

[23-Feb-2021 17:35:10 Europe/Berlin] PHP Fatal error:  Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `record`.`mydb`.`Sno` at row 1 in /www/reg.php:17
Stack trace:
#0 /www/reg.php(17): PDOStatement->execute(Array)
#1 {main}
  thrown in /www/reg.php on line 17

I had to check /opt/lampp/logs/php_error_log inside the container to find the error, but php should display errors. Since this is meant to be developer-friendly cotainer, I created #29 to track this.

Quick glance at your code suggests that your ':sno' => '' association causes this.
https://github.com/Logan1x/php-docker/blob/c3852e26a1a1468d71b07dc6c832241005162e35/reg.php#L17

from docker-xampp.

Logan1x avatar Logan1x commented on September 14, 2024

Thank you for helping out with this. Do I have to create db every time I built it? I want to push my project on docker hub so the person who is downloading image have to do create db ?

from docker-xampp.

tomsik68 avatar tomsik68 commented on September 14, 2024

I think there's a way to create the DB inside the container. You can copy your sql script to the container and then import it with mysql cli.

Please beware that this image is not ready for production. This is merely a development environment.

from docker-xampp.

Logan1x avatar Logan1x commented on September 14, 2024

Thanks I'll look into it.

from docker-xampp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.