Undefined Variable?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Undefined Variable?

Postby samik666 » 22. June 2011 12:43

Hey,
I'm getting an 'Undefined variable' error when I use a SELECT statement, for example, but the statement is syntactically correct and it functions as it should, but first I have to scroll through lines and lines of errors that say roughly along these lines..

Notice: Undefined variable: multistmt_flag in C:\xampp\htdocs\SID\sid.php on line 55

Notice: Undefined variable: a in C:\xampp\htdocs\SID\sid.php on line 118

How may I remove this clutter, there is no real error, and the files I'm using came with the tutorial I got, so they're assumedly correct?

I hope I'm not wasting anyone's time, but I'm sure I shouldn't be getting these errors..

Sam.
samik666
 
Posts: 3
Joined: 22. June 2011 09:24

Re: Undefined Variable?

Postby Altrea » 22. June 2011 13:22

samik666 wrote:Notice: Undefined variable: multistmt_flag in C:\xampp\htdocs\SID\sid.php on line 55

Notice: Undefined variable: a in C:\xampp\htdocs\SID\sid.php on line 118

How may I remove this clutter, there is no real error, and the files I'm using came with the tutorial I got, so they're assumedly correct?


It works because PHP tries to process your script anyways. Other programming languages are much more strict.

You can get rid of that by using empty() or isset()functions at that point.
I don't know your two sourcelines, so i can't give you a complete fix.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6699
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

Re: Undefined Variable?

Postby JonB » 22. June 2011 17:06

Another solution might be to change your error reporting level.

http://php.net/manual/en/function.error-reporting.php

Those are 'notices' - not errors (and also warnings is to be considered) As you pointed out, the script works; warnings and notices can be suppressed for testing and learning environments like on localhost with XAMPP, but need to be 'repaired' (as Altrea's suggestions might do) for production (live) environments.

Good Luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Undefined Variable?

Postby Ben_Benyamin » 16. July 2012 07:42

hey GUY !
I know the solution . the problem is because of your SID version is older than the XAMPP that U are using .
I have found a new SID version in the following address ( SID 2.2 ) :

http://bw.org/ldcsql/SID-CRUD-2.2.0.zip

by Bill Weinman , the lynda.com teacher !
Ben_Benyamin
 
Posts: 1
Joined: 16. July 2012 07:39
XAMPP Version: 5.5.19
Operating System: WINDOWS 7

Re: Undefined Variable?

Postby baronsona » 01. February 2013 18:37

Ben_Benyamin wrote:hey GUY !
I know the solution . the problem is because of your SID version is older than the XAMPP that U are using .
I have found a new SID version in the following address ( SID 2.2 ) :

http://bw.org/ldcsql/SID-CRUD-2.2.0.zip

by Bill Weinman , the lynda.com teacher !



Thx Ben I got this and it fix the problem for me.
baronsona
 
Posts: 1
Joined: 01. February 2013 18:34
XAMPP Version: 5.6.3
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 47 guests