Jump to content


Photo

PHP error, I need help Pls. (I'm New to PHP)


  • Please log in to reply
6 replies to this topic

#1 u0206787@nus.edu.sg

u0206787@nus.edu.sg
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 26 September 2006 - 03:00 PM

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.i have the code in PDF format, pls help me


[attachment deleted by admin]

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 26 September 2006 - 03:01 PM

helping...
follow me on twitter @PHPsycho

#3 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 26 September 2006 - 03:04 PM

Post the error and your code, nobody can help you when nobody knows the problem.

#4 steveclondon

steveclondon
  • Members
  • PipPipPip
  • Advanced Member
  • 161 posts

Posted 26 September 2006 - 03:16 PM

$qry  =mysql_query("SELECT * FROM `staff` WHERE `clue` > 0") or die(msyql_error());
echo mysql_num_rows($qry);

This should help you get the mysql error

#5 u0206787@nus.edu.sg

u0206787@nus.edu.sg
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 27 September 2006 - 10:33 AM

<?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);
?>

<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>

why i can't use the variable 'signin'? It shows it's an undefine variable. Pls anyone can spot the mistake.

#6 wildteen88

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

Posted 27 September 2006 - 11:28 AM

Where does $signin variable come from?

Prehaps use this instead:
if (isset($signin) && !empty($signin)) {


#7 u0206787@nus.edu.sg

u0206787@nus.edu.sg
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 27 September 2006 - 11:48 AM

Where does $signin variable come from?

Prehaps use this instead:

if (isset($signin) && !empty($signin)) {


Thanks wildteen88, you are great! a million thanks. It really works once I changed the code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users