Jump to content

Html

Members
  • Content count

    401
  • Joined

  • Last visited

Community Reputation

7 Neutral

1 Follower

About Html

  • Rank
    Member
  • Birthday 03/17/1989

Profile Information

  • Location
    Greater London

Recent Profile Visitors

13,223 profile views
  1. Html

    Table has error

    Right okay, So this is what it should be, <?php require('\connect_db.php'); $sql='CREATE TABLE IF NOT EXISTS forum('. 'post_id INT UNSIGNED NOT NULL AUTO_INCREMENT,'. 'first_name VARCHAR(20) NOT NULL,'. 'last_name VARCHAR(40) NOT NULL,'. 'first_name VARCHAR(20) NOT NULL,'. 'subject VARCHAR(60) NOT NULL,'. 'message TEXT NOT NULL,'. 'post_date DATETIME NOT NULL,'. 'PRIMARY KEY (post_id))'; if(mysqli_query($dbc, $sql)===True) { echo'Table "forum" created successfully'; } else { echo 'Error Creating table:'.mysqli_error($dbc); } mysqli_close($dbc); ?> The page doesn't do anything when i try to load it, which is obviously how the table would be loaded into the db.
  2. Html

    Table has error

    Okay I tried using func code that created a table. <?php $page_title = 'forum' include('includes/header.html'); require ('\connect_db.php'); $sql = 'SELECT * FROM forum'; $result = mysql_query($dbc, $sql); if ( mysqli_num_rows($result)>0) { echo '<table><tr><th>Posted By</th> <th>Subject</th><th id="msg">Message</th></tr>'; while ($rows=mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo '<tr><td>'. $row['first_name'].''. $row['last_name'].'<br>'. $row['post_date'].'</td><td>'. $row['subject'].''. $row['message'].''. } echo'</table>'; else { echo '<p>There are currently no messages.</p>'; } echo'<p><a href="post.php">Post Message</a></p>'; mysqli_close($dbc); incluide('includes/footer.html'); ?> So this is forum.php doesn't display anything. <?php require ('/connect_db.php'); if (mysqli_ping($dbc)) { echo 'MySQL Server', mysqli_get_server_info($dbc) 'on', mysqli_get_host_info($dbc); } ?> require.php And create_forum.php <?php require('\connect_db.php'); $sql='CREATE TABLE IF NOT EXISTS forum(' 'post_id INT UNSIGNED NOT NULL AUTO_INCREMENT,'. 'first_name VARCHAR(20) NOT NULL,'. 'last_name VARCHAR(40) NOT NULL,'. 'first_name VARCHAR(20) NOT NULL,'. 'subject VARCHAR(60) NOT NULL,'. 'message TEXT NOT NULL,'. 'post_date DATETIME NOT NULL,'. 'PRIMARY KEY (post_id))'; if(mysqli_query($dbc, $sql)===True) { echo'Table "forum" created successfully'; } else { echo 'Error Creating table:'.mysqli_error($dbc); } mysqli_close($dbc); ?>
  3. Html

    Table has error

    What column? It was Post_id, so either way it doesn't work. The php pages don't display anything, I copied from the book, so not sure what is going on here. The book is from the series by Mike Mcgrath php 7 in easy steps. As for the index.html, what is that about? forum.php should load without the need for a db?
  4. Html

    Table has error

    I created the files, except for the last which is called process.php, the tutorial uses a localhost, so not sure if these files would work fine on any host. The forum.php, nothing does display. It displays an index.html, but there is no step on that, require.php outside of a includes folder along with index.html, and before that htdocs which is on any free host or paid host, and that has connect_db.php includes contains a header.html, and footer, as well css file. I also tried to create the table in the database. So I can't create the table manually or using the page create_forum, nothing loads for that either.
  5. Html

    Table has error

    So that is for a php file then, not to use in the SQL section of the phpmyadmin, that is what you are stating.
  6. Html

    Table has error

    No, but this example in the book won't create a table, unless it means out the sql instructions in the page? I doubt it. I've continued with making the php files, still have to finish step 5 of one, forum.php or create_forum.php
  7. Html

    Table has error

    I have a copy of Php 7 a basic book on creating php files, this is a basic forum page where the following will be sent to a db. I'm just doing what the book has shown. I decided to just try this, as the other book Learning Php doesn't make much sense to me, and I can't get anything done for free what I'm trying to get working, a user login system, post comments and so on. By trying out the chapter in the easy book, I hope to use that as a stepping stone for a user to post comments on their own profile index page. Page 162 creating a forum, so it states require.php <?php require ('/connect_db.php'); if (mysqli_ping($dbc)) { echo 'MySQL Server', mysqli_get_server_info($dbc) 'on', mysqli_get_host_info($dbc); } <?php require ('/connect_db.php'); if (mysqli_ping($dbc)) { echo 'MySQL Server', mysqli_get_server_info($dbc) 'on', mysqli_get_host_info($dbc); } connect_db Then the step two of the forum chapter, assign SQL so then the following in my first post. Then states after now add a test report, whether the table was created successfully or describe the error on failure if(mysqli_query($dbc, $sql)=== TRUE) { echo 'table "forum" created successfully and so on.
  8. Html

    Table has error

    The example has two first_name in the book.
  9. Html

    Table has error

    CREATE DATABASE accounts; CREATE TABLE `accounts`.`users` ( `id` INT NOT NULL AUTO_INCREMENT, `first_name` VARCHAR(50) NOT NULL, `last_name` VARCHAR(50) NOT NULL, `email` VARCHAR(100) NOT NULL, `password` VARCHAR(100) NOT NULL, `hash` VARCHAR(32) NOT NULL, `active` BOOL NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ); This is from an example php files i have, this works, without the db section. Why wouldn't the book example work, I am using a free web host, but that shouldn't matter. I tried this,
  10. Html

    Table has error

    I now get this from your sql table code The example I used was from a book, which is a beginners book for php 7. Thanks.
  11. Html

    Table has error

    Hi, This error is given when I try to create a table for a db. $sql='CREATE TABLE IF NOT EXISTS forum(' 'post_id INT UNSIGNED NOT NULL AUTO_INCREMENT,'. 'first_name VARCHAR(20) NOT NULL,'. 'last_name VARCHAR(40) NOT NULL,'. 'first_name VARCHAR(20) NOT NULL,'. 'subject VARCHAR(60) NOT NULL,'. 'message TEXT NOT NULL,'. 'post_date DATETIME NOT NULL,'. 'PRIMARY KEY (post_id))'; Thanks.
  12. Html

    Mysql db data doesn't register

    I did send an email to somebody who appears to be a website designer, so I hope he can at least respond to me, I tried with a different one, but nothing so far. Just so you know, the video tutorial files, lucky I still kept them, just in case somebody could edit the code on my behalf, now the user has setup a charging system, so $5 to get a download. 😉
  13. Html

    Mysql db data doesn't register

    Well I still have the account but it scheduled for closure within two months. Is there anyone you can point me to? Any contacts? I did some searches, well there are some freelance offers, I've viewed a few sites, but these range from £79 to into the hundreds, I know a business would need to charge something to make a profit. Some free lance offers are under £20. I've viewed this odd site. http://www.alittlebitofsomething.co.uk https://www.freelancer.com Also found this interesting old topic from 2007. Just from viewing the website design offers, just ridiculous amount of money being charged, when one has wix, I have a free wix site for blender 3d. I had made a few demos, quite crappy, based of a film.
  14. Html

    Mysql db data doesn't register

    Hmm, you saw the example, that worked but was completely out of date to use $_POST (iss <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($_POST['login'])) { //user logging in require 'login.php'; } elseif (isset($_POST['register'])) { //user registering require 'register.php'; } } ?> what ever else and all that. I've been posting the examples now for months. 🤔 Like I stated, there is infinityfree, it would be a start, an actual working login system to register, post comments on a user's page, and so on. All i can do is inquire. Where do you suggest I look to try and find somebody who can make something workable on a free host for me for free to begin with, once working I will see where I can go with this. I cancelled my paid host, I couldn't keep up paying loose cash for no progress. I may eventually return, but infinityfree was better than the other free host since there are no pop up ads, dodgy ads, like install flash player and so on. Unfortunately the example code above wouldn't work, so having something that works according to infinity would be the right step.
  15. Html

    Mysql db data doesn't register

    Hmm, could you not use the tutorial files, and just type the up to date code? I would plan to use the CSS from the existing files I have. Anything small would be appreciated, I only state this query, since I haven't got a response from some random individual I contacted, may be the free offer wasn't of interest, how long would it take to create, an hour or two. Could be less if a person knows what they are doing. I may have to look elsewhere if nothing is possible.
×