Jump to content

Archived

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

u0206787@nus.edu.sg

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

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Post the error and your code, nobody can help you when nobody knows the problem.

Share this post


Link to post
Share on other sites
$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

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites
Where does $signin variable come from?

Prehaps use this instead:
[code=php:0]if (isset($signin) && !empty($signin)) {[/code]

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites

×

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.