Login

Welcome, Guest. Please login or register.

April 20, 2024, 10:54:26 am

Author Topic: Software Development- PHP, Databases,JS,HTML  (Read 1210 times)  Share 

0 Members and 1 Guest are viewing this topic.

bobovikisan

  • Adventurer
  • *
  • Posts: 13
  • Gnobbling Gnott Gnome
  • Respect: 0
Software Development- PHP, Databases,JS,HTML
« on: October 12, 2018, 06:56:55 pm »
0
 :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\
Hello fellow programmers!
I have this task where we are combining php, databases and html. It is very confusing. I somewhat got it. But I need clarity.
I made this local server:
attachment 1
Then I have had no problems creating an sql data base in Powershell.
Now the PHP :(
There is some kind of error with the php below:
attachment 2
attachment3 is the error.
Just on the side ( I'm not entirely sure what PARSE ERROR means.) Google and most programmers have a habit of using complex terminology.

It isn't possible for the database to be in the wrong location because it is saved in the same file.
Can you also explain what you changed in my code and explain what it does?

ON A SIDE NOTE: How does everyone in my class understand PHP and I don't? If I ask they'll be like do it yourself! Even my teacher. I have tried and tried. I have patience, but I don't think anyone spends 4hours pondering! The solution must be simple.

I appreciate any answer :)  :) :) :) :) :) :)


Aaron

  • Honorary Moderator
  • ATAR Notes Legend
  • *******
  • Posts: 3932
  • Respect: +1536
Re: Software Development- PHP, Databases,JS,HTML
« Reply #1 on: October 12, 2018, 07:07:56 pm »
0
Hi, as far as I can see you have used $result in your while loop when it should be $results?

Most of your errors are due to your array returning nothing, due to the above. Fix that and have a go. Lines 10 and 11 are your culprit.
Experience in teaching at both secondary and tertiary levels.

website // new forum profile

bobovikisan

  • Adventurer
  • *
  • Posts: 13
  • Gnobbling Gnott Gnome
  • Respect: 0
Re: Software Development- PHP, Databases,JS,HTML
« Reply #2 on: October 12, 2018, 07:13:54 pm »
0
THANK YOU! hehe that was incredibly stupid. I am actually surprised my code actually functions the way I wan it to for once! :)

Aaron

  • Honorary Moderator
  • ATAR Notes Legend
  • *******
  • Posts: 3932
  • Respect: +1536
Re: Software Development- PHP, Databases,JS,HTML
« Reply #3 on: October 12, 2018, 07:15:27 pm »
0
You are most welcome. It is one of the most common issues with coding/programming in general, minor things like that. We've all done it.

Thank you for posting what you have done too, I am more than willing to help if I see students who have had a go at things themselves first. :)


Also with your "I don't understand PHP" issue - programming/coding takes time, you can't just click your fingers and be a professional at it. From what you've done so far, I think you doubt yourself unnecessarily. You were spot on with your code apart from that one error in the variable name. Have some faith :)
« Last Edit: October 12, 2018, 07:20:25 pm by Aaron »
Experience in teaching at both secondary and tertiary levels.

website // new forum profile