This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-10-04 13:29:52

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

What's wrong here?

Okay! I have this php code:

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  sad


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#2 2011-10-04 13:55:53

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

Anyone?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#3 2011-10-04 15:18:20

roijac_test
Scratcher
Registered: 2011-08-31
Posts: 49

Re: What's wrong here?

no idea. sorry

could you explain what it should do?


http://gigabyte.50webs.com/funnyerrormessages/work013.jpg

Offline

 

#4 2011-10-04 15:29:24

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: What's wrong here?

Does it give an error? And yes, what is it supposed to do?

Offline

 

#5 2011-10-04 15:35:51

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

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  hmm


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#6 2011-10-04 15:41:58

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: What's wrong here?

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  hmm

Do you have any info in your database, yet?  tongue

Offline

 

#7 2011-10-04 16:03:28

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

Got it! Mmmmmm... cheese burger!


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#8 2011-10-04 16:05:24

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: What's wrong here?

WindowsExplorer wrote:

Got it! Mmmmmm... cheese burger!

lol
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.  smile

Offline

 

#9 2011-10-04 16:08:33

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

ProgrammingFreak wrote:

WindowsExplorer wrote:

Got it! Mmmmmm... cheese burger!

lol
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.  smile

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!  wink  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  wink


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#10 2011-10-04 16:16:06

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: What's wrong here?

WindowsExplorer wrote:

ProgrammingFreak wrote:

WindowsExplorer wrote:

Got it! Mmmmmm... cheese burger!

lol
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.  smile

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!  wink  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  wink

Done. And thanks.  smile

Offline

 

#11 2011-10-04 16:17:01

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: What's wrong here?

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?


http://i.imgur.com/zeIZW.png

Offline

 

#12 2011-10-04 16:18:09

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

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?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#13 2011-10-04 16:19:18

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

ProgrammingFreak wrote:

WindowsExplorer wrote:

ProgrammingFreak wrote:


lol
So it works? I would like to help with it more. Maybe be a dev. Or maybe I could just make my own blog.  smile

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!  wink  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  wink

Done. And thanks.  smile

Ok! I'll add your account!


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#14 2011-10-04 16:35:05

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: What's wrong here?

Are you editing right now? Cause it isn't letting me login cause there are errors that keep changing.

Offline

 

#15 2011-10-04 16:42:46

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

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  wink


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#16 2011-10-04 16:45:49

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

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!


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#17 2011-10-04 16:50:46

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: What's wrong here?

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.  big_smile

Offline

 

#18 2011-10-04 17:07:29

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

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.  big_smile

Yea! That feature took a LONG time to make!


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#19 2011-10-04 17:29:06

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: What's wrong here?

All the pictures in your sig are gone


http://i.imgur.com/zeIZW.png

Offline

 

#20 2011-10-04 17:30:12

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: What's wrong here?

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  wink


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#21 2011-10-04 17:33:25

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: What's wrong here?

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  wink

Ah ok


http://i.imgur.com/zeIZW.png

Offline

 

Board footer