The error is in below lines of the addressed file below (Line 186 & 187):
Website (Live): www.healthyminds.world
Tried restoring an earlier back-up(24 hours back), but that didn't work also.
Line 186 & 187 from source line:
$collections = get_option('google_typography_collections');
$google_fonts_all = $this->get_fonts();
$import_fonts = array();
if ($collections) {
foreach ($collections as $collection) {
$font_family = $collection['font_family'];
$font_index = array_search($font_family,
array_column($google_fonts_all,'family'));//Line 186
$font_variants = implode(',', $google_fonts_all[$font_index ['variants']); //Line 187
array_push(
$import_fonts,
array(
'font_family' => $collection['font_family'],
'font_variant' => $font_variants,
Error Messages (On All Pages Of Website, these are just few of the lines):
content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 186
Warning: array_search() expects parameter 2 to be array, null given in /home/customer/www/healthyminds.world/public_html/wp-content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 186
Warning: Illegal string offset 'variants' in /home/customer/www/healthyminds.world/public_html/wp-content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 187
Warning: implode(): Invalid arguments passed in /home/customer/www/healthyminds.world/public_html/wp-content/themes/elumine/includes/integrations/google-typography/google-typography.php on line 187
You are getting the errors because on line 186 the $google_fonts_all either does not contain an array with 'family' key or it is not an array. In either case the expression, array_column($google_fonts_all, 'family'), returns empty.
You can extract the later expression into a variable:
$family = array_column((array)$google_fonts_all, 'family');
On the line 187, check for the isset( $google_fonts_all[$font_index]['variants'] ) either in a conditional statement or itenary.
Regards
Eliasu
Wisdom Labs has posted a patch to fix the problem.
There's something weird going on with server-side Datatables from this: https://github.com/n1crack/Datatables.
Don't understand what's going on, i do exactly the same thing as the examples but it simply doesn't work. According to the "where" example https://github.com/n1crack/Datatables/blob/master/public/examples/where/ajax.php, look how simple it should be:
$dt = new Datatables(new MySQL($config));
$dt->query("Select film_id as fid, title, description from film where film_id > 47 and film_id < 83");
echo $dt->generate();
My code:
$config = [ 'host' => 'localhost',
'port' => '3306',
'username' => 'root',
'password' => '',
'database' => 'sys_db_gincana' ];
$dt = new Datatables( new MySQL($config) );
$dt->query("
SELECT seen, id, name, cep, date_format(created,'%d/%m/%Y %h:%i:%s') as created
FROM user
");
echo $dt->generate();
Now look at what my js console prints from my ajax:
A PHP Error was encountered
Severity: 4096 Message: Argument 1 passed to
PHPSQLParser\builders\WhereBuilder::build() must be of the type array,
boolean given, called in C:\Program Files
(x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\gincana\vendor\greenlion\php-sql-parser\src\PHPSQLParser\builders\SelectStatementBuilder.php
on line 74 and defined Filename: builders/WhereBuilder.php
Line Number: 112
A PHP Error was encountered
Severity: Warning Message: Invalid argument supplied for
foreach() Filename: builders/WhereBuilder.php Line
Number: 114
A PHP Error was encountered
Severity: 4096 Message: Argument 1 passed to
PHPSQLParser\builders\WhereBuilder::build() must be of the type array,
boolean given, called in C:\Program Files
(x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\gincana\vendor\greenlion\php-sql-parser\src\PHPSQLParser\builders\SelectStatementBuilder.php
on line 74 and defined Filename: builders/WhereBuilder.php
Line Number: 112
A PHP Error was encountered
Severity: Warning Message: Invalid argument supplied for
foreach() Filename: builders/WhereBuilder.php Line
Number: 114
Fatal error: Call to a member function
fetch_assoc() on a non-object in C:\Program Files
(x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\gincana\vendor\ozdemir\datatables\src\DB\MySQL.php
on line 40
And if if i change the query to:
$dt = new Datatables( new MySQL($config) );
$dt->query("
SELECT seen, id, name, cep, date_format(created,'%d/%m/%Y %h:%i:%s') as created
FROM user
WHERE approved = 0 and canceled = 0
");
echo $dt->generate();
the error changes:
A PHP Error was encountered
Severity: Warning Message: array_merge(): Argument #2 is
not an array Filename: src/Datatables.php Line Number:
47
Fatal error: Call to a member function
fetch_assoc() on a non-object in C:\Program Files
(x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\gincana\vendor\ozdemir\datatables\src\DB\MySQL.php
on line 40
Well, the library is a bit new (january 2015), i wonder if someone that had success using it could help me.
Regards
The problem in the WhereBuilder comes from the PHPSQLParser, can you test the latest version from https://github.com/greenlion/PHP-SQL-Parser? It seems to be a simple SQL statement, so actually it should work. I have moved your issue to GitHub, please follow the changes there.
function readDB($db,$event)
{
try {
$rows = array();
$sql = "SELECT \"Red Score\", \"Blue Score\", red1, red2, red3, blu1, blu2, blu3 FROM Matches WHERE Event='$event' AND Type='Q' ORDER BY Number;";
foreach($db->query($sql) as $row)
{
$rows[] = $row;
echo count($row) . "<br/>";
}
printArray($rows);
} catch(PDOException $e) {
$rows = 'aids';
echo $e->getMessage();
}
$db = null;
}
Here's the relevant function. It runs the query and puts the results into a 2D array. Changing the query to select only one field with no conditions still returns two things.
The code returns the right data, just each record is duplicated, ie a row of eight is turned into a row of 16. The query when run in the SQLite3 console returns each thing once.
Sample:
PHP:
51 51 27 27 836 836 435 435 1102 1102 245 245 88 88 1293 1293
33 33 30 30 401 401 3489 3489 415 415 3475 3475 4722 4722 2655 2655
SQLite3:
51 27 836 435 1102 245 88 1293
33 30 401 3489 415 3475 4722 2655
Can anybody explain why this is happening?
EDIT: My apologies. I've replaced the pastes with embedded code. Should've thought to do that.
EDIT EDIT: Solution: Set the default fetch mode with PDOStatement::setAttribute(); it defaults to FETCH_BOTH which is causing this issue. I looked in the wrong place for a solution.
Docs are here, for more information: http://www.php.net/manual/en/pdostatement.fetch.php
'By default PDO will fetch an array of results indexed by column name and by column numbers (ie. the values from the DB appear in the array twice, with two different keys). So if you're using the default fetch mode, you're probably cycling through both of those representations of the result set.' Thank you, Liv, this explanation helps.
Solution: Set the default fetch mode with PDOStatement::setAttribute(); it defaults to FETCH_BOTH which is causing this issue. I looked in the wrong place for a solution.
Docs are here, for more information: http://www.php.net/manual/en/pdostatement.fetch.php
In my CakePHP 2.2 application I get a "notice" inside my debug.log file. I get this warning nearly every day but I couldn't solve the problem. So I need to write some additional data inside debug.log. But I want to write that data when this "notice" occurs.
For example I get this notice:
2012-09-26 19:53:01 Notice: Notice (8):
Trying to get property of non-object in
[/var/www/vhosts/example.com/app/View/Tools/index.ctp, line 42]
Trace:
include - APP/View/Tools/index.ctp, line 42
View::_evaluate() - CORE/Cake/View/View.php, line 920
View::_render() - CORE/Cake/View/View.php, line 883
View::render() - CORE/Cake/View/View.php, line 475
Controller::render() - CORE/Cake/Controller/Controller.php, line 957
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 193
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 161
[main] - APP/webroot/index.php, line 96
I want to add all session variables into debug.log file when this notice occurs.
How can I do this?
Can I change lib/Cake/Log/Cakelog.php
What should I write and where?
Edit: I paste the related code snippet:
39 <?php if ($auth) { ?>
40 <form class="well" >
41
42 <?php if (isset($user->profile_url)) {
43 echo '<img src="'.$user->profile_url.'" width="48" height="48"/>';
44 } ?>
45
46 <strong><?php echo $user->screen_name; if (isset($user->name)) { echo " (" . $user->name . ")"; } ?></strong><br/>
47 <small><?php if (isset($user->description)) { echo $user->description; } ?> </small><br/>
48 <small><?php if (isset($user->url)) { echo $user->url; } ?> </small><br/>
49 <br/>
I'm a noob to php/mysql programming and I had this form working but when I got a new computer it won't work. The HTML is a form that send the results to the php page which kicks it into a WAMP mysql database. Like I said, I had this all working beautifully and I got a new machine, reinstalled WAMP, copied over the database and info, and now it gives me nothing but notices and if I add die(mysql_error()) to the end ot the $sql - ("SELECT..... like it was before, it gives me a cannot connect error.
<?php
$q=$_GET["q"];
$con = mysql_connect("localhost","root","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("kalen_qc", $con);
$sql = ("SELECT `id` FROM `users` WHERE `username` = ' " . $root . " ' and `password` = ' " . $password . " ' limit 1");
//Retrieve data from the sql Query String
$cname = $_GET["cname"];
$job = $_GET["job"];
$apptype = $_GET["apptype"];
$priority = $_GET["priority"];
$daterec = $_GET["daterec"];
$datereq = $_GET["datereq"];
$po = $_GET["po"];
$authby = $_GET["authby"];
$phone = $_GET["phone"];
$fax = $_GET["fax"];
$motorplantnumber = $_GET["motorplantnumber"];
$quoted = $_GET["quoted"];
$incomphoto = $_GET["incomphoto"];
$repvalue = $_GET["repvalue"];
$eyebolt = $_GET["eyebolt"];
$motorassem = $_GET["motorassem"];
$conduitbox = $_GET["conduitbox"];
$conboxpos = $_GET["conboxpos"];
$coupler = $_GET["coupler"];
$couplexten = $_GET["couplexten"];
$couplrecess = $_GET["couplrecess"];
$couplflush = $_GET["couplflush"];
$motorweight = $_GET["motorweight"];
$motorfreq = $_GET["motorfreq"];
$application = $_GET["application"];
$appdesc = $_GET["appdesc"];
$specinstruc = $_GET["specinstruc"];
$reasonserv = $_GET["reasonserv"];
$obviousdamage = $_GET["obviousdamage"];
$cussupplyprod = $_GET["cussupplyprod"];
// Escape User Input to help prevent SQL Injection
$cname = mysql_real_escape_string($cname);
$job = mysql_real_escape_string($job);
$apptype = mysql_real_escape_string($apptype);
$priority = mysql_real_escape_string($priority);
$daterec = mysql_real_escape_string($daterec);
$datereq = mysql_real_escape_string($datereq);
$po = mysql_real_escape_string($po);
$authby = mysql_real_escape_string($authby);
$phone = mysql_real_escape_string($phone);
$fax = mysql_real_escape_string($fax);
$motorplantnumber = mysql_real_escape_string($motorplantnumber);
$incomphoto = mysql_real_escape_string($incomphoto);
$repvalue = mysql_real_escape_string($repvalue);
$motorassem = mysql_real_escape_string($motorassem);
$conduitbox = mysql_real_escape_string($conduitbox);
$conboxpos = mysql_real_escape_string($conboxpos);
$coupler = mysql_real_escape_string($coupler);
$couplexten = mysql_real_escape_string($couplexten);
$couplrecess = mysql_real_escape_string($couplrecess);
$couplflush = mysql_real_escape_string($couplflush);
$motorweight = mysql_real_escape_string($motorweight);
$motorfreq = mysql_real_escape_string($motorfreq);
$application = mysql_real_escape_string($application);
$appdesc = mysql_real_escape_string($appdesc);
$specinstruc = mysql_real_escape_string($specinstruc);
$reasonserv = mysql_real_escape_string($reasonserv);
$obviousdamage = mysql_real_escape_string($obviousdamage);
$cussupplyprod = mysql_real_escape_string($cussupplyprod);
$sql="INSERT INTO motor_checkin (cname, job, apptype, priority, daterec, datereq, po, authby, phone, fax, motorplantnumber, quoted, incomphoto, repvalue, eyebolt, motorassem, conduitbox, conboxpos, coupler, couplexten, couplrecess, couplflush, motorweight, motorfreq, application, appdesc, specinstruc, reasonserv, obviousdamage, cussupplyprod)
VALUES
('$_GET[cname]','$_GET[job]','$_GET[apptype]','$_GET[priority]','$_GET[daterec]', '$_GET[datereq]','$_GET[po]','$_GET[authby]','$_GET[phone]','$_GET[fax]','$_GET[motorplantnumber]', '$_GET[quoted]','$_GET[incomphoto]','$_GET[repvalue]','$_GET[eyebolt]','$_GET[motorassem]','$_GET[conduitbox]','$_GET[conboxpos]','$_GET[coupler]','$_GET[couplexten]','$_GET[couplrecess]', '$_GET[couplflush]','$_GET[motorweight]','$_GET[motorfreq]','$_GET[application]','$_GET[appdesc]', '$_GET[specinstruc]','$_GET[reasonserv]','$_GET[obviousdamage]','$_GET[cussupplyprod]')";
if (!mysql_query($sql,$con));
{
die('Error: ' . mysql_error());
}
header("Location: /");
mysql_close($con);
?>
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META http-equiv="Content-Typetext/html; charset=iso-8859-1">
<title>Kalen Electric Repair Packet</title>
<link rel="stylesheet" type="text/css" href="qcstyle.css" />
<link rel="icon" href="images/favicon.ico" />
<!-- This conditional is for IE8 and IE6 and earlier- 8 needs that display:table -->
<!--[if !IE 7]>
<style type="text/css">
#wrap {display:table;height:100%}
</style>
<![endif]-->
<script type="text/javascript">
function showUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if
(xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","insert.php?q="+str,true);
xmlhttp.send();
}
function loadXMLDoc()
{
}
</script>
</head>
<body>
<div id="wrap"> <!-- This wrap div needs to encompass everything except the footer div at bottom -->
<div id="header">
<div id="logo"> <!-- this extra div is just centering the fixed width area of the header content -->
<img src="images/logo.png" alt="Kalen Electric and Machinery Inc Quality Control" class="logo"/>
</div>
</div>
<div id="main">
<!-- Inside this main div we are floating the content to the left and the sidebar to the right -->
<div id="content">
<h1>Motor Check-In:</h1>
<form action="insert.php" method="post" id="horizontalForm">
<div class="box">
<fieldset>
<label>
<span>Customer:</span>
<select class="cname" name="cname"><option value="">Select One</option> <option value="GP Wauna">GP Wauna</option> <option value="GP Toledo">GP Toledo</option> <option value="GP Camas">Gp Camas</option></select>
</label>
<label>
<span>Job Number:</span>
<input class="job" type="integer" name="job" onClick="this.value=''"/>
</label>
<label>
<button type="button" onclick="loadXMLDoc()">New Job</button>
</label>
</fieldset>
<fieldset>
<label>
<span>Apparatus Type: </span>
<select class="apptype" name="apptype"> <option value="AC Motor">AC Motor</option> <option value="AC Motor 1ph">AC Motor 1ph</option> <option value="AC Motor/Gearhead">AC Motor/Gearhead</option>
<option value="AC Welder">AC Welder</option> <option value="AC Submersible">AC Submersible</option> <option value="Stator Only">Stator Only</option>
<option value="Service Call">Service Call</option> <option value="AC Generator">AC Generator</option></select>
</label>
<label>
<span>Priority:</span>
<select class="priority" name="priority"> <option value="P1">P1</option> <option value="P2">P2</option> <option value="P3">P3</option></select>
</label>
</fieldset>
<fieldset>
<label>
<span>Date Received:</span>
<input class="daterec" type="date" size="12" maxlength="10" name="daterec" onClick="this.value=''"/>
</label>
<label>
<span>Date Required:</span>
<input class="datereq" type="date" size="12" maxlength="10" name="datereq" onClick="this.value=''"/>
</label>
<label>
<span>PO#:</span>
<input class="po" type="text" size="12" maxlength="20" name="po" onClick="this.value=''"/>
</label>
<label>
<span>Authorized By:</span>
<input class="authby" type="text" size="12" maxlength="30" name="authby" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Phone#:</span>
<input class="phone" type="text" size="12" maxlength="12" name="phone" onClick="this.value=''"/>
</label>
<label>
<span>Fax#:</span>
<input class="fax" type="text" size="12" maxlength="12" name="fax" onClick="this.value=''"/>
</label>
<label>
<span>Motor Plant#:</span>
<input class="motorplantnumber" type="text" size="12" maxlength="20" name="motorplantnumber" onClick="this.value=''"/>
</label>
<label>
<span>Quoted:</span>
<select class="quoted" name="quoted"> <option value="No">No</option> <option value="Yes">Yes</option></select>
</label>
</fieldset>
<fieldset>
<label>
<span>Incoming Photo As Received:</span>
<select class="incomphoto" name="incomphoto"> <option value="No">No</option> <option value="Yes">Yes</option></select>
</label>
<label>
<span>Replacement Value:</span>
<input class="repvalue" type="text" size="12" maxlength="7" name="repvalue" onClick="this.value=''"/>
</label>
<label>
<span>Eye-Bolt:</span>
<select class="eyebolt" name="eyebolt"> <option value="Good">Good</option> <option value="Bad">Bad</option> <option value="None">None</option></select>
</label>
</fieldset>
<fieldset>
<label>
<span>Motor Assembly:</span>
<select class="motorassem" name="motorassem"> <option value="F1">F1</option> <option value="F2">F2</option> <option value="Vertical">Vertical</option></select>
</label>
<label>
<span>Conduit Box:</span>
<select class="conduitbox" name="conduitbox"> <option value="Full">Full</option> <option value="Half">Half</option> <option value="None">None</option></select>
</label>
<label>
<span>Conduit Box Position:</span>
<select class="conboxpos" name="conboxpos"> <option value="3:00">3:00</option> <option value="6:00">6:00</option> <option value="9:00">9:00</option> <option value="12:00">12:00</option> </select>
</label>
</fieldset>
<fieldset>
<label>
<span>Coupler/Pulley:</span>
<select class="coupler" name="coupler"> <option value="Coupler">Coupler</option> <option value="Pulley">Pulley</option> <option value="None">None</option> </select>
</label>
<label>
<span>Extended:</span>
<input class="couplexten" type="text" size="12" maxlength="10" name="couplexten" onClick="this.value=''"/>
</label>
<label>
<span>Recessed:</span>
<input class="couplerecess" type="text" size="12" maxlength="10" name="couplrecess" onClick="this.value=''"/>
</label>
<label>
<span>Flush:</span>
<input class="couplflush" type="text" size="12" maxlength="10" name="couplflush" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Motor Weight:</span>
<input class="motorweight" type="text" size="12" maxlength="10" name="motorweight" onClick="this.value=''"/>
</label>
<label>
<span>Motor On Frequency Drive:</span>
<select class="motorfreq" name="motorfreq"> <option value="Yes">Yes</option> <option value="No">No</option> </select>
</label>
</fieldset>
<fieldset>
<label>
<span>Application:</span>
<select class="application" name="application"> <option value="Direct Coupled">Direct Coupled</option> <option value="Belted">Belted</option> </select>
</label>
<label>
<span>Application Description:</span>
<input class="appdesc" type="text" size="12" maxlength="100" name="appdesc" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Special Instructions:</span>
<input class="specinstruc" type="text" size="12" maxlength="255" name="specinstruc" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Reason For Service:</span>
<input class="reasonserv" type="text" size="12" maxlength="255" name="reasonserv" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Obvious Damaged or Missing Parts:</span>
<input class="obviousdamage" type="text" size="12" maxlength="255" name="obviousdamage" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Customer Supplied Product:</span>
<input class="cussupplyprod" type="text" size="12" maxlength="255" name="cussupplyprod" onClick="this.value=''"/>
</label>
</fieldset>
<label>
<input type="submit" /><br />
</label>
</div>
</form>
</div>
</div>
</div> <!-- close the wrap div here -->
<div id="footer">
<div id="foot"> <!-- this extra div is just centering the fixed width area of the footer content -->
<div id="left">
<p>Kalen Electric and Machinery Inc.</p>
</div>
<div id="right">
<p>AC Induction - Version 1.0</p>
</div>
</div>
</div>
</body>
</html>
Errors it returns:
( ! ) Notice: Undefined index: q in C:\wamp\www\insert.php on line 2
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined variable: root in C:\wamp\www\insert.php on line 13
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined variable: sprocket in C:\wamp\www\insert.php on line 13
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cname in C:\wamp\www\insert.php on line 16
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: job in C:\wamp\www\insert.php on line 17
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: apptype in C:\wamp\www\insert.php on line 18
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: priority in C:\wamp\www\insert.php on line 19
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: daterec in C:\wamp\www\insert.php on line 20
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: datereq in C:\wamp\www\insert.php on line 21
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: po in C:\wamp\www\insert.php on line 22
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: authby in C:\wamp\www\insert.php on line 23
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: phone in C:\wamp\www\insert.php on line 24
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: fax in C:\wamp\www\insert.php on line 25
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorplantnumber in C:\wamp\www\insert.php on line 26
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: quoted in C:\wamp\www\insert.php on line 27
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: incomphoto in C:\wamp\www\insert.php on line 28
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: repvalue in C:\wamp\www\insert.php on line 29
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: eyebolt in C:\wamp\www\insert.php on line 30
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorassem in C:\wamp\www\insert.php on line 31
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conduitbox in C:\wamp\www\insert.php on line 32
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conboxpos in C:\wamp\www\insert.php on line 33
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: coupler in C:\wamp\www\insert.php on line 34
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplexten in C:\wamp\www\insert.php on line 35
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplrecess in C:\wamp\www\insert.php on line 36
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplflush in C:\wamp\www\insert.php on line 37
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorweight in C:\wamp\www\insert.php on line 38
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorfreq in C:\wamp\www\insert.php on line 39
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: application in C:\wamp\www\insert.php on line 40
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: appdesc in C:\wamp\www\insert.php on line 41
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: specinstruc in C:\wamp\www\insert.php on line 42
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: reasonserv in C:\wamp\www\insert.php on line 43
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: obviousdamage in C:\wamp\www\insert.php on line 44
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cussupplyprod in C:\wamp\www\insert.php on line 45
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cname in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: job in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: apptype in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: priority in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: daterec in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: datereq in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: po in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: authby in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: phone in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: fax in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorplantnumber in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: quoted in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: incomphoto in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: repvalue in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: eyebolt in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorassem in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conduitbox in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conboxpos in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: coupler in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplexten in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplrecess in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplflush in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorweight in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorfreq in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: application in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: appdesc in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: specinstruc in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: reasonserv in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: obviousdamage in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cussupplyprod in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
The answer is in the notice itself. The entry for q does not exist in your query string.
It's best to build error handling and input validation to ensure that the appropriate variable exists.
$q = (isset($_GET['q']) ? $_GET['q'] : null);
Since you are setting and referencing multiple variables, I would suggest you create a function that you can pass the corresponding variable. This not only checks for existence of the corresponding variable, but it also escapes the variable for use in your query.
<?php
function varExist($var){
return (isset($_GET[$var]) ? mysql_real_escape_string($_GET[$var]) : null);
}
$q = varExist('q');
...
?>
Please note that per the documentation:
Use of this extension is discouraged. Instead, the MySQLi or PDO_MySQL
extension should be used. See also MySQL: choosing an API guide and
related FAQ for more information. Alternatives to this function
include:
■mysqli_real_escape_string() ■PDO::quote()
There is additional documentation pertaining to the suggested alternative, mysqli_real_escape_string(), that you may review.
Basically all of your variables are empty. Make sure to initialize them at the start of the code. This way you won't get undefined index warnings.
$q = '';
$cname = '';
...etc
Side Note
This is really REALLY dangerous. Never use $_Get when running sql. The user can perform sql injection attacks that way.
INSERT ... Values ('$_GET[cname]','$_GET[job]'
Much Much Better
$cname = mysql_real_escape_string($cname);
$job = mysql_real_escape_string($job);
Insert ... Values (' . $cname . ', ' . $job . '
Those are all notices, not errors. Most likely the new PHP installation has a stricter error reporting level and the previous computer just suppressed the same notices.
The notices themselves mean that the form has not yet been submitted or there's some other related problem why form data hasn't been sent.
Your variables ("q", "root", "sprocket" etc..) should be coming from another page, hence the $_GET call. Have you tried running the form first? If you are simply loading this page on it's on, the variables will not be populated.
In your case this might be the way to go: Set this in the very first line of your script:
// Report all errors except E_NOTICE
error_reporting(E_ALL ^ E_NOTICE);
This will simply NOT GIVE OUT those "error" messages. This is not a good way to code, but in this case it's the best quick & dirty solution.