Jump to content

u0206787@nus.edu.sg

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

u0206787@nus.edu.sg's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks dymon & btherl, I agree with you that people had been debating it but to me I keep wondering why and what the different. Yet from the web I can't find any that clearly state as what both of you had explain in just some simple words. That's a great help, thanks for your time.
  2. Sorry if I'm asking something funny or sound stupid, but I really wish to find out what are the limitation for PHP and MySQL. What so different between Javascript or Perl to PHP?
  3. [code] if (isset($adminsignin) && !empty($adminsignin)) { $connect = mysql_connect($host, $user, $password); if (!$connect) {   die('Not connected : ' . mysql_error()); } $db=mysql_select_db($database, $connect); if (!$db) {   die ('Can\'t use $database: ' . mysql_error()); } $result = mysql_query("SELECT * FROM Admin where AdminID = '$adminid' and Password='$pwd'") or die(mysql_error()); if ($row = mysql_fetch_array($result)) { } else { } } mysql_close(); ?> [/code] No i had checked, the nos of open blacket is equal to the nos of close bracket. Other than bracket, where you see the error could be? thanks again.
  4. [quote author=Gaoshan link=topic=109943.msg444106#msg444106 date=1159593097] [code]mysql_close($connect)[/code] [/quote] when I use "mysql_close($connect);" it give me 2 errors as below. 1. Notice: Undefined variable: 2. Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in however if I were to use "mysql_close();" it gave me an error as: 1. Warning: mysql_close(): no MySQL-Link resource supplied . What wrong with this quote?
  5. [code] <?php if (isset($signin) && !empty($signin)) { $connect = mysql_connect($host, $user, $password); if (!$connect) {   die('Not connected : ' . mysql_error()); } $db=mysql_select_db($database, $connect); if (!$db) {   die ('Can\'t use $database: ' . mysql_error()); } $result = mysql_query("SELECT * FROM Registration where studentid = '$studentid' and password='$pwd'") or die(mysql_error()); mysql_close(); [/code] Can anyone help me Pls? "Warning: mysql_close(): no MySQL-Link resource supplied ". I'm running on EasyPHP 1.8.0.1; with Apache 1.3.33; PHP 4.3.10; MySQL 4.1.9.
  6. [quote author=ProjectFear link=topic=109943.msg443614#msg443614 date=1159529620] you should have to put [code]$db=mysql_select_db($database, $connect);[/code] you can just put: [code]mysql_select_db($database, $connect);[/code] and when using mysql_close you dont have to specify the link identifier. it can simply be: [code]mysql_close();[/code] and it will close the last open connection. [/quote] Thanks, however this time it showing another error. This time, it's showing: "Warning: mysql_close(): no MySQL-Link resource supplied ". I'm running on EasyPHP 1.8.0.1; with Apache 1.3.33; PHP 4.3.10; MySQL 4.1.9.
  7. [code] $connect = mysql_connect($host, $user, $password); if (!$connect) {    die('Not connected : ' . mysql_error()); } $db=mysql_select_db($database, $connect); if (!$db) {    die ('Can\'t use $database: ' . mysql_error()); } mysql_close($connect); [/code] Pls find what wrong with the code, I keep receive these errors. These are the two error I received. 1. Undefined variable: connect 2. Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in c:\program files\easyphp1-8\www\test\login.php on line 86 Cheers.
  8. [quote author=wildteen88 link=topic=109922.msg443562#msg443562 date=1159521224] [quote author=extrovertive link=topic=109922.msg443501#msg443501 date=1159507003] Ya, I thought of that, but isn't there a PHP way like using ob_flush or something? [/quote] Yes that is correct: [code]<?php ob_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>   <title>Redirecting...</title> </head> <body> You will be redirected to google in approx 2 secounds. <?php header("Refresh:2; URL=http://www.google.com"); ?> </body> </html> <?php ob_end_flush(); ?>[/code] [/quote] Instead of re-direct to a webpage in the internet, if I want to direct to another php page inside the same folder, what should the sytnax will be? thanks.
  9. [quote author=wildteen88 link=topic=109557.msg442315#msg442315 date=1159356494] Where does $signin variable come from? Prehaps use this instead: [code=php:0]if (isset($signin) && !empty($signin)) {[/code] [/quote] Thanks wildteen88, you are great! a million thanks. It really works once I changed the code.
  10. [code]<?php if ( $signin != "" ) { // Make a MySQL Connection $link = mysql_connect($host, $user, $password) or die(mysql_error());; mysql_select_db("myfirstphp_uk_db") or die(mysql_error()); mysql_close($link); ?> [/code] [code]<tr> <td width="100%" align="center"><input type="submit" value="Sign In" name="signin" tabindex="3"><input type="reset" value="Reset" name="B2"></td> </tr> </form> <tr> <td width="100%">&nbsp;</td> </tr>[/code] why i can't use the variable 'signin'? It shows it's an undefine variable. Pls anyone can spot the mistake.
  11. [code] <?php if ( $signin != "" ) { // Make a MySQL Connection $link = mysql_connect($host, $user, $password) or die(mysql_error());; mysql_select_db("myfirstphp_uk_db") or die(mysql_error()); mysql_close($link); ?> [/code] [code]<tr> <td width="100%" align="center"><input type="submit" value="Sign In" name="signin" tabindex="3"><input type="reset" value="Reset" name="B2"></td> </tr> </form> <tr> <td width="100%">&nbsp;</td> </tr>[/code] the above is the quote. 1. Undefined variable: on line 41 ([color=red]if ( $signin != "" ) {[/color] ) 2. Undefined variable: on line 75 ([color=red]mysql_close($link); {[/color] ) Sorry, I didnt mean to double post my problem, but I'm still unable to get an solution for it. I'm running on EasyPHP 1.8.0.1; with Apache 1.3.33; PHP 4.3.10; MySQL 4.1.9. Pls anyone can advise
  12. 1. Undefined variable: on line 41 (if ( $signin != "" ) { ) 2. Undefined variable: on line 75 (mysql_close($link); { ) 3. mysql_close(): supplied argument is not a valid MySQL-Link resource on line 75 4. Undefined variable: on line 77 (if ( $adminsignin != "" ) { ) 5. Undefined variable: on line 105 (mysql_close($link); { ) 6. mysql_close(): supplied argument is not a valid MySQL-Link resource on line 105 I'm running on EasyPHP 1.8.0.1; with Apache 1.3.33; PHP 4.3.10; MySQL 4.1.9. Pls I need your kind advise. Sorry I can post the code here, keep prompting me error. Hence i have the code in PDF format, pls help me. [attachment deleted by admin]
  13. 1. Undefined variable: on line 41 ([color=red]if ( $signin != "" ) {[/color] ) 2. Undefined variable: on line 75 ([color=red]mysql_close($link); {[/color] ) 3. mysql_close(): supplied argument is not a valid MySQL-Link resource on line 75 4. Undefined variable: on line 77 ([color=red]if ( $adminsignin != "" ) {[/color] ) 5. Undefined variable: on line 105 ([color=red]mysql_close($link); {[/color] ) 6. mysql_close(): supplied argument is not a valid MySQL-Link resource on line 105 I'm running on EasyPHP 1.8.0.1; with Apache 1.3.33; PHP 4.3.10; MySQL 4.1.9. Pls I need your kind advise.i have the code in PDF format, pls help me [attachment deleted by admin]
×
×
  • 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.