Jump to content
xisto Community
Sign in to follow this  
readme123456

Learning Php/sql Basics Want to learn CSS, PHP and create a website

Recommended Posts

Hello,I've been wanting to learn to create websites for a long time. I'm not sure how hard it will be and how long it will take to learn enough to make my own database-driven website. I studied SQL, basic programming, worked with databases and am familiar with HTML tags, but this all was for work, university and I never paid a lot of attention to details.In the past few days I read beginner's tutorials on PHP/SQL, CSS and even HTML.Now I want to create a simple database with some tables to practice with PHP scripts for a website, write and read database information.The idea for a site I have is for users to share their reviews of certain products, with capability of adding pictures and video to their writing.I thought I can create a table with products' names, pictures, links to reviews, etc, as the column values and then read and write from and to this table via web interface.The biggest fear I have right now, haven't yet completed anything, is the amount of crucial symbols in PHP and CSS. It seems hard to remember to write <?php ?> instead of something else, or put '...' for text strings and "..." for values in functions like echo.I'd appreciate any good advices for a novice or comments on my post. Not sure if this is too informative, so questions also appreciated, of course!

Share this post


Link to post
Share on other sites

Well, sounds like you have a lot of work ahead of you...

 

I learned PHP and MySQL from a book called PHP Fast & Easy Web Development 2nd Edition by Julie C. Meloni

 

Here is a list of related books: https://www.amazon.com/ref=nb_sb_noss_null

 

While I suggest learning PHP5 as soon as possible, I must stress that having a good book for nearly any version of PHP is very helpful.

 

This book shows how to do many of the tasks that you want to improve upon and I still refer to the book frequestly.

 

I also have a copy of PHP 5 Unleashed by John Coggeshall

 

Many of these books are available used for very little money (less than $5.00 US).

 

 

I'll add more information as I get time.

 

vujsa

Share this post


Link to post
Share on other sites

Thanks.My concern is that I need an SQL Server to practice PHP scripts reading and writing data to it. I know that installing SQL Server on my laptop will make it hard to work with, it's not fast enough. I applied to Xisto, but seems like I won't get an account posting in the forum without any knowledge to share.

Share this post


Link to post
Share on other sites

it would still probably work out quicker just to install apache, mysql, php and phpmyadmin than to go hosting it on a host. if you are using a host to try out all your php scripts then you will have to spend the time uploading them. if u just had them on your computer then all you would have to do is save the script to the htdocs folder and go to localhost/wotever.php

Share this post


Link to post
Share on other sites

Thanks.
Does this package contain what you listed and what I need to start? http://www.wampserver.com/en/

Should I rather install everything on its own and practice configuring MySQL and PHP to work together, or just use the package to avoid possible problems?

Also, isn't Apache for Linux or was until very recently?

Thanks!

Edited by readme123456 (see edit history)

Share this post


Link to post
Share on other sites

Ok,I didn't wait for your answer and installed WAMP5.Right now I can't get MySQL to respond to commands: I go to MySQL console, choose 'test' database and try to make it display any information, but it does nothing.Here's a screenshot with no results for 'show' and 'explain' commands:

Share this post


Link to post
Share on other sites

I now have much more basic questions and they appear rapidly. Where should I post with beginner's PHP coding questions like this:

 

Creating and loading a .php file:

<?phpecho "<P>This is a test using the first tag type.</P>"?>
for some reason displays

This is a test using the first tag type.

 

")?>

with the part that is supposedly simply ending echo and php script.

What have I done wrong?

 

 

Another strange thing happened, one of the sites I frequent stop displaying any content, just their header and an error message, while page source has <!-- Error: 2013:Lost connection to MySQL server during query --> line in it. They too use php, so I'm not sure if my local settings can interfere with the browser? Though Xisto is working, so I'm not sure what's the problem.

 

Thanks.

Edited by vujsa (see edit history)

Share this post


Link to post
Share on other sites

I now have much more basic questions and they appear rapidly. Where should I post with beginner's PHP coding questions like this:

 

Creating and loading a .php file:

<?php

echo "<P>This is a test using the first tag type.</P>"?>

for some reason displays

This is a test using the first tag type.

 

")?>

with the part that is supposedly simply ending echo and php script.

What have I done wrong?


for the part that they display ")?>, try to code it with the ending of ; and a space. eg.

 

<?php echo "this is a test using the first tag type"; ?>

Another strange thing happened, one of the sites I frequent stop displaying any content, just their header and an error message. They too use php, so I'm not sure if my local settings can interfere with the browser? Though Xisto is working, so I'm not sure what's the problem.

And for just the header, normally when there's error message, it will stop at the error message without displaying the whole things. So if you can put up those error message here, then maybe we can narrow down the problem. By the way, you can use xampp for your apache webserver with mysql database. Its all set and user friendly. Worth a try. Cheers

Share this post


Link to post
Share on other sites

readme, instead of double and triple posting, your meant to edit your post.

 

you should try xampp, its got apache, mysql, php, phpmyadmin, openssl and an smtp server and a few other things in one. its from apachefriends.org, let me just find the site... https://www.apachefriends.org/index.html

 

im gathering youll want to choose the windows one? click the windows link and download the full one, not the lite edition.

Share this post


Link to post
Share on other sites

Thanks both of you for the links. Does this imply you do not advise using WAMP5 - a similar package with MySQL, PHP5, PHPMyAdmin and Apache?

In this case can you still give me an idea of what is wrong with my ignored commands in the MySQL console (screenshot above)?

 

As for the php test page problems, I did actually write exactly what kelvinmaki wrote:

<?phpecho "<P>This is a test using the first tag type.</P>";?>
and still get

This is a test using the first tag type.

 

"; ?>

on the actual page. And removing <P>, </P> tags returns an empty page.

 

The website I cannot load is http://forums.xisto.com/no_longer_exists/ and it stopped loading right after I installed the package with MySQL, Apache and PHP. Try for yourself, I'm sure you can load the whole page with no problems. And like I wrote before, their main page source now has this bit in it

<!-- Error: 2013:Lost connection to MySQL server during query -->

Thank you for bearing with me.
Edited by readme123456 (see edit history)

Share this post


Link to post
Share on other sites

i hardly know the basics of php and i dont no anything about mysql besides how to set up a database and that.i cant help you with your problem.im not saying you HAVE to use xampp, i just like it better (ive used both). but if your actually making a server then your meant to install the real things separately.

Share this post


Link to post
Share on other sites

I'm not saying that WAMP5 is not a good package as I've tested that as well. But personally, I would prefer xampp. And of course with the lite version.

 

As for the php test page problems, I did actually write exactly what kelvinmaki wrote:

<?phpecho "<P>This is a test using the first tag type.</P>";?>
and still get

This is a test using the first tag type.

 

"; ?>

on the actual page. And removing <P>, </P> tags returns an empty page.


Anyway regarding to your code below, I've tested it in xampp server in my localhost and it just show everything correctly. Why don't you uninstall your WAMP5 server and install xampp. Try it out and see you get the same problem. I'm really curious that you have that "; ?> showing. :rolleyes:

 

The website I cannot load is http://forums.xisto.com/no_longer_exists/ and it stopped loading right after I installed the package with MySQL, Apache and PHP. Try for yourself, I'm sure you can load the whole page with no problems. And like I wrote before, their main page source now has this bit in it

<!-- Error: 2013:Lost connection to MySQL server during query -->

I'm pretty sure that the Lost connection to MySQL server error for http://forums.xisto.com/no_longer_exists/ was due to time out that closed the connection. By default, the server closes the connection after xx hours or xxxxx seconds if nothing has happened to the connection.

Share this post


Link to post
Share on other sites

With the semicolon there, the code is fine and should display correctly. If you remove the paragraph tags, the display should be okay as well.

 

Perhaps you should look at the source code for the page displayed in your browser and post the HTML if any that is there.

 

I do not use WAMP5, XAMPP, or any other pre-packaged web server software.

I manually installed Apache, PHP, MySQL, and even PERL. As a result, my system reacts more like an actual server instead of a test platform. The only difference is that because I use Windows, some of the Apache modules are available and there are a few limitations with PHP.

 

Be sure that you clear your browsers cache between tries.

 

As for your connection problem at shanghaiexpat.com, I cannot see any way that you recent installation would cause the error. More than likely, they are having a few problems of their own and you just happened to try and visit during this time. Again, clear your cache and try again.

 

As for your database issues, have you created a root user and password? Have you created the database named "test"?

 

Remember, you have to use the mysqladmin command prompt program to create users and databases but to work with a database, it's tables, and data, you use the mysql command prompt program.

 

Installing a PHP based MySQL interface is a good idea if you get overwhelmed with the command prompt. phpMyAdmin is the usual method of doing this!

 

Please start a new topic in the PHP forum if you encounter any further problems with PHP as it will likely get more attention there and is off topic here!

 

vujsa

Share this post


Link to post
Share on other sites

kelvinmaki, I already uninstalled WAMP5 and plan to install xampp. Curiously enough, after uninstalling WAMP5 I could surf shanghaiexpat.com again. It really seems to me there is a connection between the fact that I had a server installed and that problem, especially because they always put a message on the main page, if there is some maintenance work going on.

vujsa, I will just answer your post here and then stop asking about PHP. I did not have any HTML in the source page, it was actually just those two lines, and I copied them from a manual! Anyway, I'll try xampp and see what happens.

I also wanted to install all components manually, but then thought I could practice other things, like coding and designing pages first, then go to configuring servers by myself.

 

Thanks everyone for answers.

Share this post


Link to post
Share on other sites

kelvinmaki, I already uninstalled WAMP5 and plan to install xampp. Curiously enough, after uninstalling WAMP5 I could surf shanghaiexpat.com again. It really seems to me there is a connection between the fact that I had a server installed and that problem, especially because they always put a message on the main page, if there is some maintenance work going on.

For WAMP5 package, there might be some kind of configuration you need to do or the package overwrite your system HOST file for redirecting to the internet. Anyway you can try out xampp package for your learning phase of PHP programming. And a good start of installing those webserver package will be focusing on programming alone. It will take awhile to configure all those server and database manually but of course If you are a more technical side who need to know how things work. Then go ahead.

 

Anyway those two lines should work in Xampp as that's what I've did to in my Xampp webserver. Good luck

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.