Jump to content

Recommended Posts

Posted

I've created a php file which creates MySQL Tables. I've added a error variable and a success variable, $err[]=Error messages, $ok[]=Success messages. When running the file I'm neither getting the erro messages nor the success messages. So, can anyone fix my code?

Here is my full php script: http://www.pastebin.com/zDEXR06h

Posted

PHP runs from the top down. You put the code that displays the contents of the arrays before the code that puts the stuff in them. They're always empty because the code that puts the results in hasn't been run yet.

 

Move the code block that shows the array entries (lines 19 to 40) to line 319 (after the queries and if (!$q#) stuff but before the footer) and it should work.

  • Like 1
Posted

And one more thing sir, I'm getting the following error:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/sgs/includes/code_highlighter.php:18) in /home/sgs/public_html/global/layouts/sgs2014.php on line 2
Warning: session_start() [function.session-

start]: Cannot send session cache limiter - headers already sent (output started at /home/sgs/includes/code_highlighter.php:18) in /home/sgs/public_html/global/layouts/sgs2014.php on line 2

What does it means?

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
×
×
  • Create New...