Jump to content

EasyPHP - MySQL and phpmyadmin


Psycho-Path

Recommended Posts

I am having a problem with mysql and phpmyadmin, not sure which one it is, but when I make a database and everything, the information isn't being sent!  I have had several sites but this is the first time for me to have one on a local server..so I'm kind of new to this, especially since I used to use cPanel.  So I'm wondering... what am I doing wrong?


This is what I used on this b/c it didn't give me any errors.  Infact..it didn't give me any information, the page was blank..
[code]<?php
$database="cms"; //Your database name
$mysql_user = "localhost_root"; //Your database username to login with
$mysql_password = ""; //Your database password to login with
$mysql_host = "localhost"; //Your server, Tends to be localhost

$success = mysql_connect ($mysql_host, $mysql_user, $mysql_password);
if (!$success)
die ("Cannot connect to database, check if username, password and host are correct."); //Message if it connected correctly
$success = mysql_select_db ($database);
if (!$success) {
print "Cannot choose database, check if database name is correct."; //Message if the connection failed.
die();
}
?>[/code]


This is what I used to use when I had a payed host (cusername stands for my cpanel username)
[code]<?php
$database="cusername_database"; //Your database name
$mysql_user = "cusername_username"; //Your database username to login with
$mysql_password = "password"; //Your database password to login with
$mysql_host = "localhost"; //Your server, Tends to be localhost

$success = mysql_connect ($mysql_host, $mysql_user, $mysql_password);
if (!$success)
die ("Cannot connect to database, check if username, password and host are correct."); //Message if it connected correctly
$success = mysql_select_db ($database);
if (!$success) {
print "Cannot choose database, check if database name is correct."; //Message if the connection failed.
die();
}
?>[/code]

Please tell me why the information is not being sent! :(


Also I am having a problem parsing the information:

[code]<?php
include 'parser.php';
$parser = new parser();

$default_text = <<<EOF
:) :(
This is a sample text. [url=http://phpfreaks.com]PHP Freaks[/url] is a PHP website :)

[b]bold[/b] [b]bold again[/b] [i]italic[/i] [u]underline[/u]

left
[center]center[/center]
[right]right[/right]

[url]http://phpfreaks.com[/url]

[[email protected]]Somebody's mail[/mail]
[mail][email protected][/mail]

[center][url=http://google.com][img]http://www.google.com/intl/en/images/logo.gif[/img][/url][/center]
EOF;

$text = !empty($_POST['text']) ? $_POST['text'] : $default_text;
$ps_checked = (bool)$_POST['parse_smilies'] ? " checked='checked'" : null;
$pbbc_checked = (bool)$_POST['parse_bbcodes'] ? " checked='checked'" : null;

echo <<<EOF
<form action='{$_SERVER['REQUEST_URI']}' method='post'>
<label><input type='checkbox' name='parse_smilies' value='1'{$ps_checked}> Parse smilies</input></label><br />
<label><input type='checkbox' name='parse_bbcodes' value='1'{$pbbc_checked}> Parse BBcodes</input></label><br /><br />

<label>Text to parse:<br /><textarea cols='10' rows='15' style='width: 100%;' name='text'>{$text}</textarea></label><br /><br />

<button type='submit'>Parse text</button>
</form>
EOF;

if(!empty($_POST['text']))
{
    $parser->parse_smilies = (bool) $_POST['parse_smilies'];
    $parser->parse_bbcodes = (bool) $_POST['parse_bbcodes'];
    $text = $parser->parse($_POST['text']);
   
    echo <<<EOF

<hr />

<div style='overflow: auto; height: 200px;'>{$text}</div>

EOF;
}
?>[/code]

[quote="Error"]
Notice: Undefined index: parse_smilies in c:\program files\easyphp1-8\www\bbcode\index.php on line 24

Notice: Undefined index: parse_bbcodes in c:\program files\easyphp1-8\www\bbcode\index.php on line 25[/quote]


Hope you guys can help me, and it didn't look like jibberish..

Thanks,
Andrew
Link to comment
https://forums.phpfreaks.com/topic/28163-easyphp-mysql-and-phpmyadmin/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.