Jump to content

hpub

Members
  • Posts

    18
  • Joined

  • Last visited

hpub's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hpub

    list users

    i'm using that code but i still get 500 error but i see the sucess message if not showing nothing of table users
  2. hpub

    list users

    its from my site its a remote db
  3. hpub

    list users

    for exemple if you put , by mistake, a wrong dbname it should show cannot connect to database but instead it gives a 500 error
  4. hpub

    list users

    i've got G:\PleskVhosts\mysite\subdomain Successful database connection, happy coding!!!
  5. hpub

    list users

    ok i try again and it connects saying sucess mesage but it you put wrong pw or dbname it doesnt not show the cannot connect to db it gives a 500 error
  6. hpub

    list users

    where i add getcwd()
  7. hpub

    list users

    i tried you code with the (fix for connnection) but i get 500 error can you rpovide a code with pdo to test?
  8. hpub

    list users

    i use this witch work fine $username = "myuser"; $password = "mypass"; $hostname = "myserver"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL "; //select a database to work with $selected = mysql_select_db("calendar",$dbhandle) or die("Impossivel seleccionar base de dados"); } //close the connection mysql_close($dbhandle); ?> but i want a echo message saying Conected! but it gives me a 500 error
  9. hpub

    list users

    can you also explain how i make relationship between tables in phpmyadmin?
  10. hpub

    list users

    ok its a remote database. also the code you provide work fine i wiil try to make a table to list all records from that table, based on the example some posts above but i cant understand why when everything is fine i get a 500 error(see my previous post with code) because if name of db is wrong it gts on the echo else gives that 500 error
  11. hpub

    list users

    its a remote db. what i see is that if i put a wrong name in db , for example it shows the error message, but if everything is fine it gives error 500 also when tried to create a table in phpmyadmin (see previous post) it gives me syntax error in last line
  12. hpub

    list users

    ok i will use code tag yes what i understand is that when everything is Ok IT SHOWS the 500 error when not it gives the error like now: Connected to MySQL Cant found DB (i put the wrong name in db to test and it shows the error message, as suposed) but when i try to execute a query i cant it gives 500 error
  13. hpub

    list users

    i used this code <?php $username = "myuser"; $password = "mypass"; $hostname = "myserver"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("calendar",$dbhandle) or die("Impossivel seleccionar base de dados"); } //close the connection mysql_close($dbhandle); ?> for example when i use this if i mistake one numer on server ip it should say unable to connect but instead if gives a 500 error any any other error with will not show and gives the 500 error because then i add this and it gives me the 500 error: //execute the SQL query and return records $result = mysql_query("SELECT Description FROM no_calendar"); echo mysql_errno($result) . ": " . mysql_error($result) . "\n"; also i'm trying to create a new table but it gives an error at last line SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; CREATE TABLE `aluno` ( `Id` int(11) NOT NULL auto_increment, `idfoto` int(11) character set utf8 default NOT NULL, `idaula` int(11) character set utf8 default NOT NULL, `Nome` varchar(200) character set utf8 default NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; any help is much apreciated
  14. hpub

    list users

    i got this to connect to db also <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Test Time</title> </head> <body> <?php $db_conx = mysqli_connnect('MY_WEBSITE.secureserver.net', 'MY_USERNAME', 'MY_PASSWORD', 'DATABASE_NAME'); // Evaluate the connection if (mysqli_connect_errno()) { echo "cannot connect to database"; echo mysqli_connect_error(); exit(); } else { echo "Successful database connection, happy coding!!!"; } ?> </body> </html> but i got 500 error ...but this code producce the expected result <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Test Time</title> </head> <body> <?php $today = date('y-m-d'); print "(<p><b>Today is $today</b></p>)"; $time = date('h-g-s'); echo "(<p><b>and the time is $time</b></p>)"; print("<p>Parentheses</p>"); ?> </body> </html> i dont know why in frist case i got 500 error any ideia?
  15. hpub

    list users

    i saw this http://forums.phpfreaks.com/topic/291035-list-users/ but i got all php code has normal text when i see in browser
×
×
  • 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.