Jump to content


Photo

what is wrong with this script pls tell me


  • Please log in to reply
2 replies to this topic

#1 alarik149

alarik149
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 08 March 2006 - 09:52 AM

<?php

$db = mysql_connect(host', 'championships', 'passwd')
mysql_select_db('championships', $db);
$sql = "UPDATE register SET status = 'inactive' WHERE username = 'a'";
$result = mysql_query($sql) or die(mysql_error());

?>

why dosen`t this script work?I have 1 database named championships and 1 table named register.with 2 fields 'username' and 'status'.i don`t get it.it connects to the database good but it dosen`t change anything,no errors,no nothing.why?:( pls help me

Tired of math homework ? Just visit http://www.solvemymath.com for a free online math solver and calculator.
Videochat bucuresti studio -> http://www.GirlAddicts.com
About the adult video chat business -> www.girlplan.com

#2 Randy

Randy
  • Members
  • PipPip
  • Member
  • 25 posts
  • LocationNewcastle, UK

Posted 08 March 2006 - 05:29 PM

... connect(host', ...

that should be connect('host', ...

*EDIT*
also add a semicolon at the end of the first line...

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 10 March 2006 - 03:23 PM

Change:
$db = mysql_connect(host', 'championships', 'passwd')
mysql_select_db('championships', $db);
to
$db = mysql_connect('host', 'championships', 'passwd') or die("MySQL Connection Error: " . mysql_error());
mysql_select_db('championships', $db) or die("Selecting database error: " . mysql_error());
If theres a problem with your connection or if your database has a problem then you should recieve an message.

Also why post this in HTML Help Forum? Why not PHP Help?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users