Php Error Use Of Undefined Constant
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more use of undefined constant php - assumed 'php' about Stack Overflow the company Business Learn more about hiring developers or posting php define global constant ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack use of undefined constant laravel Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR- Use of undefined constant root - assumed 'root' [duplicate] up use of undefined constant php assumed php codeigniter vote -2 down vote favorite This question already has an answer here: Use of undefined constant erorr in php 2 answers Please can I get help for this problem Here's the code: if( $_GET["sender"] == "Ajax" ) require_once "../db/connector.php"; else if ( $_GET["sender"] == "Ajax5" ) require_once "../db/connector.php"; else require_once "db/connector.php"; //require_once "db/dbclass.php"; $mysql = new Datalink(localhost,root,'','whatsapp_dbase'); $id = $_GET['id']; Here's the Error Message Notice: Use of undefined constant
Use Of Undefined Constant Php Define
root - assumed 'root' in C:\wamp\www\whatsapp\db\mobilefx.php on line 9 Notice: Undefined index: id in C:\wamp\www\whatsapp\db\mobilefx.php on line 11 Notice: Use of undefined constant localhost - assumed 'localhost' in C:\wamp\www\whatsapp\db\mobilefx.php on line 9 Notice: Undefined index: sender in C:\wamp\www\whatsapp\db\mobilefx.php on line 2 php mysql share|improve this question edited Jul 29 '15 at 22:43 asked Jul 29 '15 at 22:38 Ndiokwelu Zubby 62 marked as duplicate by YvesLeBorg, Fred -ii-, mariophp Users with the php badge can single-handedly close php questions as duplicates and reopen them as needed. Jul 29 '15 at 22:49 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 1 Strings like localhost and root need to be "quoted".... 'localhost' and 'root' –Mark Baker Jul 29 '15 at 22:41 did you mean $root and $localhost by any chance ? –YvesLeBorg Jul 29 '15 at 22:41 'root' and 'localhost' –Ndiokwelu Zubby Jul 29 '15 at 22:42 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote Many problems in this code : Notice: Use of undefined constant root Change : $mysql = new Datalink(localhost,root,'','whatsapp_dbase'); To : $mysql = new Datalink(lo
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About
Use Of Undefined Constant - Assumed Laravel
Us Learn more about Stack Overflow the company Business Learn more about hiring use of undefined constant wordpress developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join define constant php the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Use of undefined constant error http://stackoverflow.com/questions/31712354/error-use-of-undefined-constant-root-assumed-root in php up vote -3 down vote favorite The following code $email_domain, email=>$email_user, password=>$email_pass, quota=>$email_quota); echo json_encode($call); ?> generated following error: Notice: Use of undefined constant domain - assumed 'domain' in C:\xampp\htdocs\test2.php on line 7 Notice: Use of undefined constant email - assumed 'email' in C:\xampp\htdocs\test2.php on line 7 Notice: Use http://stackoverflow.com/questions/27597900/use-of-undefined-constant-error-in-php of undefined constant password - assumed 'password' in C:\xampp\htdocs\test2.php on line 7 Notice: Use of undefined constant quota - assumed 'quota' in C:\xampp\htdocs\test2.php on line 7 {"domain":"abc@gmail.com","email":"Roshan","password":"admin","quota":"200"} I want to know the occurrence of this and in this case what can be done to prevent this error. php warnings share|improve this question edited Mar 20 at 20:07 Roman C 34.4k133559 asked Dec 22 '14 at 6:56 rdkrosan 516 2 You have to put the key in quotes! –Rizier123 Dec 22 '14 at 6:58 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted array(name => value) is not a valid syntax, php doesn't now what name is. You need quotation marks around your array keys. Use array("domain" => $email_domain, ... etc. share|improve this answer answered Dec 22 '14 at 6:58 meagar♦ 136k21203238 add a comment| up vote 1 down vote You should use quotes around the keys in the array, like this :- $call = array('domain'=>$email_domain, 'email'=>$email_user, 'password'=>$email_pass, 'quota'=>$email_quota); share|improve this answer answered Dec 22 '14 at 6:58 Khushboo 1,4261313 add a comment| up vote 1 down vote If you want to use literals as your array keys, you
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask a Question View Unanswered Questions View All Questions... Linux questions C# questions http://www.codeproject.com/Questions/619252/Notice-Use-of-undefined-constant-Y-assumed-Y-in-xa ASP.NET questions SQL questions fabric questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site use of Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site use of undefined Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ why PHP Notice: Use of undefined constant Y - assumed 'Y' in xampp 1.8.2 for define (Y,120) Rate this: Please Sign up or sign in to vote. See more: PHP Apache xampp hi file test.php is : ?php define(Y,120); ?> after upgrade xampp version to 1.8.2 , When executing script there is given notice: Notice: Use of undefined constant Y - assumed 'Y' Posted 10-Jul-13 19:29pm Mahnoosh_M1.2K Updated 10-Jul-13 19:54pm v4 Add a Solution Comments timmit18 11-Jul-13 1:36am show your code. Mahnoosh_M 11-Jul-13 1:57am it is just one line define(Y,120); timmit18 11-Jul-13 2:03am have you tried wrapping Y with single quote? Mahnoosh_M 11-Jul-13 2:07am Thanks, solved timmit18 11-Jul-13 2:11am your welcome. accept my answer.please :) Mahnoosh_M 11-Jul-13 3:09am you sent your solution in comments .. I cant accept it . Please add your solution . then I will accept it . thank you 1 solution Rate this: Please Sign up or sign in to vote. Solution 1 Accept Solution Reject Solution have you tried wrapping Y with single quote? :) Permalink Posted 10-Jul-13 21:13pm zenspace1.1K Add a Solution A