SQT11 / Universidad

Creacion de una pagina web , con mysql , html ,php , css , mas crud ( En desarrollo Tarea), Para una universidad cualquiera,
1 stars 0 forks source link

php version #5

Open carlosdaniel26 opened 1 year ago

carlosdaniel26 commented 1 year ago

Which php version has used in this project? I try run the code but it has strange erros, and i think it's version error.

SQT11 commented 1 year ago

the version being used is : PHP 8.0.28 (cli) (built: Feb 14 2023 12:12:55) ( ZTS Visual C++ 2019 x64 ) Copyright (c) The PHP Group Zend Engine v4.0.28, Copyright (c) Zend Technologies

A strange error that is being witnessed at the time of execution is that when I hit the add button sends me directly to the person controller and shows me a blank page, it would be very helpful if you could help me to correct this problem, you can update in the master branch.

Translated with www.DeepL.com/Translator (free version)

carlosdaniel26 commented 1 year ago

If I am reading the code correctly, the controller is not doing anything, right? This happens because the controller is just a class, and it is not being accessed, just loaded, it is like a function, you need to create and execute the function

SQT11 commented 1 year ago

Yes of course, the controller is not doing anything and it is a bit confusing for me because I don't have the necessary experience to solve these types of problems, but I still try to look for documentation to be able to solve the problems in the best way.

carlosdaniel26 commented 1 year ago

image actually I just saw that the class is being used here, so I will see what is going wrong

SQT11 commented 1 year ago

When registering and logging into the page I think if they access correctly, but in the person view, I think there are problems when adding a student in the DB and sends me directly to the controller, but I have not found errors in the registration and login.

carlosdaniel26 commented 1 year ago

I just saw that I confused the files, but it is similar to what I said in the beginning, persona controller is a class, and it is just being created and not used, so I guess I thought of a solution

I'll try it here, if it works I'll make a pull request

SQT11 commented 1 year ago

Okay, could you also give me some context on how you solved it so I can understand it a little bit?

carlosdaniel26 commented 1 year ago

I had problems last night and couldn't send the pull request with the explanation, but I'm already online again and will send it now with the explanation

SQT11 commented 1 year ago

Good morning, I will review the changes later as I am in class right now, but I will take the time to review it and if I have any problems I will let you know and yes, we should connect on discord, but I can only do it by text chat as I do not speak English.

carlosdaniel26 commented 1 year ago

No problem, and if we want to do a voice conversation I don't think we will have so much trouble, since you speak Spanish, and as I speak Portuguese from Brazil we won't have so much trouble understanding each other's language

SQT11 commented 1 year ago

Encontre varios errores al momento de hacer agregacion de los datos, estos errores los presencie por medio de logs en xampp : son estos [23-Jun-2023 15:28:06 Europe/Berlin] PHP Fatal error: Uncaught mysqli_sql_exception: Out of range value for column 'per_documento' at row 1 in /Applications/XAMPP/xamppfiles/htdocs/Universidad/Models/PersonaModel.php:15 Stack trace:

0 /Applications/XAMPP/xamppfiles/htdocs/Universidad/Models/PersonaModel.php(15): mysqli_stmt->execute()

1 /Applications/XAMPP/xamppfiles/htdocs/Universidad/Controller/PersonaController.php(28): PersonaModel->insertData('Prueba', '123123132213', 'ensan@gmail.com', '3333333', 'Estudiante')

2 /Applications/XAMPP/xamppfiles/htdocs/Universidad/Controller/PersonaController.php(72): PersonaController->agregarPersona(Array)

3 {main}

thrown in /Applications/XAMPP/xamppfiles/htdocs/Universidad/Models/PersonaModel.php on line 15.

SQT11 commented 1 year ago

I also solved a problem in the deletion by id, as this id was linked to another table I implemented another formula where you can delete in cascade, I could also make the change in the database, but time does not give me because I have to deliver a part next week on Tuesday.

carlosdaniel26 commented 1 year ago

I'll take a look at the model, it shouldn't be difficult since it's a very small file, and one detail that is good to know since you told me you are using xampp, I will also correct the routes, I modified them to be used with php commands like "php -S localhost -t Universidad", but now knowing that you use xampp when you execute the routes it will give an error, so I will correct them too

carlosdaniel26 commented 1 year ago

It will take me a while to be able to help, probably 1 hour, I am formatting my ubuntu because of some problems I had with the partition

SQT11 commented 1 year ago

Don't worry, take your time, I just got home anyway, so I will upload a pull request to update the form of the include which is more efficient, besides that I also made a query for the cascade elimination.

carlosdaniel26 commented 1 year ago

Looks like you are online, I just set up the whole environment on my ubnutu, does the model problem still persist?

SQT11 commented 1 year ago

Yes, here I am already making the subject controller, the problem of the person controller has been solved by your help, thank you very much.

carlosdaniel26 commented 1 year ago

What about the PersonaModel error, does it still happen?

SQT11 commented 1 year ago

No, the error is already fixed thanks to you, I also made an improvement in the include_once, this improvement was recommended to me in my class. I show you
image

SQT11 commented 1 year ago

am making the changes here https---github.com-SQT11-University

carlosdaniel26 commented 1 year ago

Ok, any problem in code?

SQT11 commented 1 year ago

Do you know how to bring data from two database tables to two dropdowns ?

carlosdaniel26 commented 1 year ago

bring data from two tables, I think you just need to do 2 queries, right?

SQT11 commented 1 year ago

yes, but how would you apply it to dropdown?

carlosdaniel26 commented 1 year ago

basically first you do the dropdawn with html, and then just make the query, then get the result of the query and replace the dropdawn data by the query data, I made this explanation very abstract because you have not explained very well which page, with which data, with which table, if you want to explain me better, you can send me a message at my discord:kalanguin just send me a friend request there and send me a