Develop applications PHP & MySQL

good morning Tom butler,
I’m Andrea and I have 22 years I bought your free device with php and mysql 2018 but I would have only two questions that I beg you to answer please.

in the free I downloaded all the folders with the examples from GIT

1) because when you evaluate the database on phpmyadmin and try to create a user my dice “beware you do not have the privileges to create new users” in database.sql I see that there is LOCK TABLES author WRITE?

2) after all the folders that I have which are those where I can reuse the code in other web sites to cover everything?

Important: last thing if now I wanted to start a new website which are the folders downloaded from github that I can reuse and not those specific to the Joke project. Esemple. Register,login, function personalize general …

BOOK IMAGE FONT Tom Butler: https://images-na.ssl-images-amazon.com/images/I/51GnBWsZclL._SX348_BO1,204,203,200_.jpg

BOOK IMAGE BACK Tom Butler: https://images-na.ssl-images-amazon.com/images/I/81aMg3qfbrL.jpg

tank you

Hi Andrea,

Can you explain what you mean in more detail. I’m not sure I understand what you are trying to ask:

  1. because when you evaluate the database on phpmyadmin and try to create a user my dice “beware you do not have the privileges to create new users” in database.sql I see that there is LOCK TABLES author WRITE?

The sample code exists and is designed to work with the inbuilt switcher, you can clone the repository and visit e.g. http://191.168.10.10/samples/ and choose a sample to load into the directory. You shouldn’t need to amend the database yourself. The instructions in the appendix will guide you through setting up the sample code. Alternatively, you can just browse the repository on github ( https://github.com/spbooks/phpmysql6 ) and compare it to your own.

  1. after all the folders that I have which are those where I can reuse the code in other web sites to cover everything?

Sorry I’m afraid I don’t understand what you are asking here. You can use any of the code from the book on any website you build in future. In the book I get you to create two folders (and corresponding namespaces): Ninja and Ijdb. The Ninja directory contains code that is completely generic: There’s nothing relating to the joke website and it can be copied across directly. You may wish to base, for example, and “Add Product” page on the “Add Joke” page from the joke website, though obviously this code won’t be the same.

hy Tom,

  1. sorry the problem with mysql was caused by MAMP PRO, I solved MAMP reload …

  2. instead I refer to the written question better in English.
    I downloaded the 00 folders with the .zip format from the github portal

I ask you if these folders have a generic code that can be used for other projects or if I have to change something inside for future sites that I will do?
or if you can tell me what are the generic folders with the code not customized for JOKE … but that I can use on other websites?

EXAMPLE:
a) these folders have a generic code right? that I can use on new projects or are customized for JOKE FOLDER →
/Structure2-GenericFunction-Save
/ Structure2-GenericFunctions
/Structure2-GenericFunctions-SaveArray

B)
/Registration-Form
/Registration-Hash
/Registration-Validation

what changes between email 1 and 2
/Registration-Validation-Email
Registration-Validation-Email-2

C)
are these folders ready to be used for other websites that I do?
/Sessions-LoginError
/Sessions-LoginCheck
/Sessions-Count
/Sessions-LoginForm
/Sessions-LoginError
/Sessions-Logout

Hi Andrea,

Please refer to the book, it does answer most of these questions! You will build up classes in the Ninja directory that can be used without modification on other websites.

Each of the branches you have listed builds on the last so that you end up with a fully functional website.

last thing I loaded the folder login-form but when I go on this link mamp I see the registration fields I enter the data inside the form and I do not come out any registration page completed … in the database has not been added any user because it does not go ?

http://localhost/templates/register.html.php

tank

Hi Andrea,

If you are asking this question I would suggest going back to the PHP chapter where templates are introduced. You should not access a template file directly (and this is partly why it’s outside the public directory.

Kind Regards,
Tom

1 Like

another thing I am attaching photos the folders are just as they were loaded or you have to pull out something from public or simple.

If you follow the instructions in introduction and the appendix for using the sample code then you’ll be able to use it. I recommend using the homestead improved vagrant box, if you’re not you may need to rename the public directory.

my book was created automatically with instructions but continued on MAC.
then I use MAMP but the module does not work …

Hi Andrea, which module? The sample switcher tool? If you are using MAMP it might not: The files in the git branches assume the public directory is called public. On apache, it might be httpdocs, htdocs or public_html so each time you switch you’ll need to move the files from public to the relevant folder.

1 Like

ciao Tom,
the main MAMP directory can not be renamed because it is the one set by MAMP …

when I upload the sample files /phpmysql6-Sessions-LoginForm
as you can see from the picture I made the path:
from open mamp open the folder mamp / htdocs and load the folder Sessions-LoginForm

if I use MAMP now what changes I have to make to the example code foder?

in the way I need to delete the public folder in htdocs and move the public files out or I need to do another one to display the registry operation correctly?

As I said in the previous post:

edit: And also, if you do not have a basic understanding of file/folder structures or server administration it will be a lot simpler to use the Homestead Improved box as everything is configured for you.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.