Issue
I am writing a simple php application with mysql integration.
I have a simple html page in which I am connecting with the database and then for verification, I want to print the host info.
I have this in the html file.
The output are the two horizontal bars with nothing between them.
What's wrong with the code?
I am writing at ubuntu 12.10, at aptana studio (also using lamp).
Solution
All indications are that your PHP is not being executed period. Your DB code may still be off, but we're not even at that point yet. This implies one of two things are going on. Either your extension is wrong, or your PHP is not configured.
First, try this script (save it as info.php):
<?php
phpinfo();
?>
If that doesn't work, then you are not configured. If that does work, then try this slightly longer bare-bones example; it's your code, sans the database connectivity. You should see a stub message between the lines. Again, don't forget the .php extension when saving it:
<!DOCTYPE html>
<html>
<head>
<title>Database Management Systems II - 2nd assignment</title>
</head>
<body>
<hr>
<?php
$link = 'link';
printf("Host information: %s\n", $link);
?>
<hr>
</body>
</html>
Answered By - RonaldBarzell
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.