drunkelf
-
Posts
16 -
Joined
-
Last visited
Posts posted by drunkelf
-
-
it works baby!sadly my book by david powers uses difrrint versions of these programs but he did say to install the latest versions availible so I am sure that I will be able to make sense of it.This wamp server thingy is so cool so easy.You can close the thead now
-
really intresting thank you I will study it in detail
-
yes that I am sure off.I will go through all the "adjustments" I made to php.ini when I first "installed" it otherwise I will use another pc.I am thinking instead of installing php 5 because that is the one used it my book I will install the latest and instead of installing phpmyadmin 2.6.4.p1 I will install the latest I am also going to use a windows installer instead of copying files like david powers told me too.
Hopefully I can follow the book using diffrint versions of these programs
-
PLease be pateint with me I am only starting out.I see there is a heading for sq lite and that sq lite has something to do with databases.That has nothing to do with my sql right?
-
This might be a dumb question but would the information about mysql in php info be plain english?I want to know what to look
thank you
-
I restarted both mysql and apache I am looking at php info but dont know what to look for because I did not find anything about mysql
-
Like this you can see that mysql has been uncommented in my php.ini file
;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
-
yes I do it was installed sucessfully
-
I followed all of the instructions and it still does not work.Here is the instructions
here is my error
cannot load mysql extension;
please check PHP configuration
<snip mod: removed hundreds of lines of copy/pasted phpmyadmin instructions and phpmyadmin config file>
-
Maybe I am just tired but I cannot seem to grasp returning values from functions using the return keyword thingy and its practical application.Maybe you can break it down for me
-
I quaote
When you pass an argument to the function, a local copy is made in the function to
store the value. Any changes made to that value affect only the local copy of the variable
in the function, not the source of the parameter. You can define parameters that
modify the source variable by defining reference parameters.
Reference parameters define references by placing an ampersand (&) directly before
the parameter in the function’s definition.
some code
<?php function capitalize( &$str, $each=TRUE ) { // First, convert all characters to lowercase $str = strtolower($str); if ($each === true) { $str = ucwords($str); } else { $str{0} = strtoupper($str{0}); } } $str = "hEllo WoRld!"; capitalize( $str ); echo $str; ?>
Ok I do not undestand reference parameters.CAn sombody help me out.I am going to continue with other lessons but would like to have a better understanding of this reference parameters.Thanks
-
SO I am learing to code php by hand the same time I am learning how to use it in dreamweaver.By hand I am working with very basic stuff but a script that comes straight from the book does not work.It os very simple little block of code but what is wrong with it.If the code in the book itself is faulty then I cant learn so please help me with this I need to learn these things so I can understand it myself
<?php echo "Executing line " . __LINE__ . " of PHP script " . __FILE_ _ . "."; ?>
-
Error is gone!I would like to understand what is happening here but right now it only needs to work.
thank you
-
You are trying to referencing an array index that doesn't exist. I assume this is happening when you load the page before you submit the form. That is a warning that should be suppressed in a production environment but is good to have on in a development environment. However, I typically use something such as below for any fields submitted in a form to work around such errors.
$name = isset($_POST['name']) ? trim($_POST['name']) : '';
You are trying to referencing an array index that doesn't exist. I assume this is happening when you load the page before you submit the form. That is a warning that should be suppressed in a production environment but is good to have on in a development environment. However, I typically use something such as below for any fields submitted in a form to work around such errors.
$name = isset($_POST['name']) ? trim($_POST['name']) : '';
OK i think I understand what you mean so where do I type in the code you gave me.IF you can tell me where I should put the code I think I will understand better
-
WHen I add this bit of code I get an error
$name = trim($_POST['name']); if (empty($name)) { $error['name'] = 'Please enter your name'; }
Notice: Undefined index: name in C:\htdocs\phpdw\contact.php on line 24
it is suppose to check whether the form for name is empty or not.The text field has a name and id of name.here is the rest of the code most of it irrevelant.Can somebody help me with this?
<?php if (array_key_exists('ewComments', $_POST)) { // mail processing script // initialize variables $to = 'heunesc@gmail.com'; // use your own email address $subject = 'Feedback from East-West Seasons'; // build the message $message = 'From: '.$_POST['name']."\n\n"; $message .= 'Email: '.$_POST['email']."\n\n"; $message .= 'Comments: '.$_POST['message']; // send the email // remove escape characters from POST array mail($to, $subject, $message); } // remove escape characters from POST array if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); } $name = trim($_POST['name']); if (empty($name)) { $error['name'] = 'Please enter your name'; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>east west seasons</title> <?php /*include('style_rules.php');*/ ?> <script type="text/Javascript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } //--> </script> </head> <body> <div id="wrapper"> <div id="titlebar"><img src="" alt="east west season" name="bluebellstop" width="738" height="32" id="bluebellstop" style="background-color: #00CC99" /></div> <div id="Main content"> <div id="nav"> <ul> <li id="thispage"><a href="index.php">Home</a></li> <li><a href="index.php">News</a></li> <li><a href="index.php">BLog</a></li> <li><a href="index.php">Gallery</a></li> <li><a href="index.php">Contact</a></li> </ul> </div> <h1>send us your comments</h1> <p>Duis aute irure dolor ut labore et dolore magna aliqua. Quis nostrud exercitation sunt in culpa lorem ipsum dolor sit amet. Excepteur sint occaecat ullamco laboris nisi ut labore et dolore magna aliqua. In reprehenderit in voluptate quis nostrud exercitation qui officia deserunt. </p><form action="<?php $_SERVER['PHP_SELF'];?>" method="post" name="Contact form" id="Contact form" onsubmit="MM_validateForm('name','','R','email','','NisEmail','message','','R');MM_validateForm('name','','R','email','','RisEmail','message','','R');return document.MM_returnValue"> <p> <label for="name">name:</label> <br /> <input type="text" name="name" id="name" /> </p> <p> <label for="email">email</label> <br /> <input type="text" name="email" id="email" /> </p> <p> <label for="message">message<br /> </label> <textarea name="message" cols="60" rows="6" id="message"></textarea> </p> <p> <input name="ewcomments" type="submit" id="ew comments" value="send comments" /> </p> </form> <p> </p> <div id="footer"> <?php include('copyright.php'); ?> </div> </div> </div> </body> </html>
My Sql Error
in MySQL Help
Posted · Edited by drunkelf
Hello everyone i need help again.I am reading a book that requires me to import a old sql file.WHen I do this get following error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 7
mysql version 5.5.24
OK so it is around line 7.this should be easy to fix but I dont know how.If you can have a look
In Need to make this work so I can finish the book even though it is outdated