PHP personnal project need help

PHP personnal project need help
0

#1

Hello every body, i’m doing a personnal project and i’m stuck on something. Can you guys help me?
Let me explain what i did already:
It’s a project where people does have an account and connect to it. If their password is lost, they can retrieve it by email.
When you are connected, you have a list of formations (exemple: html/css, java, c++…) . The person can search for a formation with a search tab or directly select the one he want by clicking on a button.
Then, it save it on a personnal page and the users can see which formation he clicked on.

Now one of the issue: It’s not free and users have each one a number of credits (15000/year for exemple) and a number of days (15 days/year). So when he submit to a formation, he must have enought credits AND days. If not, he can’t get register it.

So my idea was to retrieve the credits/number of days of the users with a fletchAll and doing the same by saving the cost of the formation (day & credits). Then if it’s ok, i would update my bdd to change de numbers of credits/days of the users.
$credit = $data[0][‘credit’];
$days = $data[0][‘days’];

	$costFormation = $data3[0]['credit'];
	$timeFormation = $data3[0]['nbDays'];
	
	$credit = $credit-$costFormation;
	$days = $days-$timeFormation;

	
	if(extract($_GET)) {
		if($credit > 0 && $days > 0) {
			$req4 = $bdd->prepare('UPDATE employe SET days = :newDays, argent = :newCredit WHERE idEmploye = $varID');
			$req4->execute(array(
				'nvJours' => $days,
				'nvArgent' => $credit
			));
			$req2 = $bdd->prepare( 'INSERT INTO selectionner (idEmploye, idFormation) VALUES (:idEmploye, :idFormation)' );
			$req2->execute(array(
				'idEmploye' => $varID,
				'idFormation' => $idFormation,
			));
		}
	}

I translated some of the stuff in english to you so you can understand


#2

I’m not sure how many people in this community may be able to help as we’re all pretty much focused on javascript. However codenewbie has a forum http://discourse.codenewbie.org and a slack channel for php here: https://codenewbie.typeform.com/to/uwsWlZ where you may be able to get help. Good luck!

If this post helped you please give me a like!


#3

Ok ! Will take a look.

edit: i can’t log on the forum :confused: