Okay! I have this php code:
<link rel="stylesheet" type="text/css" href="global.css" />
<?php
$dbHost = 'mysql6.000webhost.com'; // localhost will be used in most cases
// set these to your mysql database username and password.
$dbUser = '*';
$dbPass = *';
$dbDatabase = '*'; // the database you put the table into.
$con = mysql_connect($dbHost, $dbUser, $dbPass) or trigger_error("Failed to connect to MySQL Server. Error: " . mysql_error());
mysql_select_db($dbDatabase) or trigger_error("Failed to connect to database. Error: " . mysql_error());
// Set up our error check and result check array
$error = array();
$results = array();
// First check if a form was submitted.
// Since this is a search we will use $_GET
$query="SELECT * FROM posts";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
//***************put code to execute for every row here, like:
echo "<b>" . $row['Title:'] . "</b>";
echo "</br>";
echo $row['Message:'];
echo "By " . $row['From:'] . ".";
}
?>It displays blog posts, but I can't get it to work. It just shows a blank screen
Offline
Does it give an error? And yes, what is it supposed to do?
Offline
It is supposed to display:
the website wrote:
Blog title (in bold)
blog post (normal text)
By (username of who posted)
It reads the post details from MySQL server, bu it just shows a blank screen (apart from the blue backround I made), and not even an error message
Offline
WindowsExplorer wrote:
It is supposed to display:
the website wrote:
Blog title (in bold)
blog post (normal text)
By (username of who posted)It reads the post details from MySQL server, bu it just shows a blank screen (apart from the blue backround I made), and not even an error message
![]()
Do you have any info in your database, yet?
Offline
WindowsExplorer wrote:
Got it! Mmmmmm... cheese burger!
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.
Offline
ProgrammingFreak wrote:
WindowsExplorer wrote:
Got it! Mmmmmm... cheese burger!
![]()
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.![]()
You can help! Here's the website I'm working on: http://plaxon.comyr.com
I'll add your account to the dev login page. But when you login, there's nothing at the panel yet, but i'm making it better!
Okay, email me with this: http://gopher.punbb-hosting.com/page.php?id=7. just type in your username and what you want your account password to be
Offline
WindowsExplorer wrote:
ProgrammingFreak wrote:
WindowsExplorer wrote:
Got it! Mmmmmm... cheese burger!
![]()
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.![]()
You can help! Here's the website I'm working on: http://plaxon.comyr.com
I'll add your account to the dev login page. But when you login, there's nothing at the panel yet, but i'm making it better!Okay, email me with this: http://gopher.punbb-hosting.com/page.php?id=7. just type in your username and what you want your account password to be
![]()
Done. And thanks.
Offline
instead of using trigger_error() I suggest you use die()
and it looks like your account has been disabled.
mind showing us what your database actually looks like/has in it?
Offline
rookwood101 wrote:
instead of using trigger_error() I suggest you use die()
and it looks like your account has been disabled.
mind showing us what your database actually looks like/has in it?
its okay, I got it, and what do you mean account disabled?
Offline
ProgrammingFreak wrote:
WindowsExplorer wrote:
ProgrammingFreak wrote:
![]()
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.![]()
You can help! Here's the website I'm working on: http://plaxon.comyr.com
I'll add your account to the dev login page. But when you login, there's nothing at the panel yet, but i'm making it better!Okay, email me with this: http://gopher.punbb-hosting.com/page.php?id=7. just type in your username and what you want your account password to be
![]()
Done. And thanks.
![]()
Ok! I'll add your account!
Offline
Are you editing right now? Cause it isn't letting me login cause there are errors that keep changing.
Offline
ProgrammingFreak wrote:
Are you editing right now? Cause it isn't letting me login cause there are errors that keep changing.
I am editing! Don't worry about the navigation errors, because I'm finished that part now! Okay, I'm going to edit the logged-in successfully page, but you'll still be able to use it
Offline
ProgrammingFreak wrote:
Are you editing right now? Cause it isn't letting me login cause there are errors that keep changing.
Also, did you try dragging the navigation bar items? try it out!
Offline
WindowsExplorer wrote:
ProgrammingFreak wrote:
Are you editing right now? Cause it isn't letting me login cause there are errors that keep changing.
Also, did you try dragging the navigation bar items? try it out!
Cool.
Offline
ProgrammingFreak wrote:
WindowsExplorer wrote:
ProgrammingFreak wrote:
Are you editing right now? Cause it isn't letting me login cause there are errors that keep changing.
Also, did you try dragging the navigation bar items? try it out!
Cool.
![]()
Yea! That feature took a LONG time to make!
Offline
rookwood101 wrote:
All the pictures in your sig are gone
Yes. I had a major error with my website, so had to clear all the files - luckily I had them saved on my PC, I just didn't get time to re upload them again
Offline
WindowsExplorer wrote:
rookwood101 wrote:
All the pictures in your sig are gone
Yes. I had a major error with my website, so had to clear all the files - luckily I had them saved on my PC, I just didn't get time to re upload them again
![]()
Ah ok
Offline