Jump to content

kev

Members
  • Posts

    13
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

kev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello mac_gyver I thought something similar. I'm in France at present but using a computer and keyboard I brought with me from the UK and my logged on server is in Paris. There doesn't seem to be a standard answer to my problem. Hopefully the problem will resolve itself in about 4 weeks time when I shall be returning to the UK. I'm not sure of the position of the '?' is on a French keyboard I might have a look later. Cheers for the reply.
  2. Hello bsmithers. Video 6_9 is valid for this file as it is part of my file location, I'm following the tutorial and instead of having one index file which would open the file automatically I number them so that I can break down the tutorial into steps for reference, so index_7 identifies at what part of the tutorial I am dealing with. I am also using WAMP with localhost, the url has no problem locating the address that is until I add ?first_name=Whatever I was only required to add to the existing address line ?first_name=Whatever with that done I then pressed enter (not refresh). The url should then locate the file index-7 and open it, it shouldn't read ?last_name=Whatever as part of the address. The file will then read the url address and look for the $_GET has now been set using ? from there it should update the db. P.S I did rename index_7.php to index.php, the problem still exists.
  3. So far so good. I've reset with backticks and used single quotes within exit('$_GET not SET - '.print_r($_GET,true)); First result = Connected$_GET not SET -Array ( ) This is what I would expect and it also proves the connection to the db. The next bit is the bit that counts and that is entering ?first_name=whatever into the url and press return. Now with $_GET set when return is pressed it should update the db by inserting another record with a first_name of whatever but it doesn't it returned the following 'a bog standard search'. Your search - localhost/phpacademy/MySQLi/Video 6_9/index_7.php?first_name=whatever - did not match any documents. My problem is that I cannot see any coding error, my code was faithful to the tututrial code (which did work) but I cannot get the url input to function. One thing that shouldn't but may be a problem is that at present I am in France with a UK orientated computer and keyboard.
  4. Hello joel24. Thanks for replying. I followed your directions. First I did originally get the connected message and still got connected with following your instructions. No problem there. I didn't get a return from 'FAILED WRITING' I did have a problem with: exit("$_GET not SET - ".print_r($_GET,true)); With the " " in place, error report = Notice: Array to string conversion in C:\wamp\www\phpacademy\MySQLi\Video 6_9\index_7.php on line Without the " " in place. error report = Parse error: syntax error, unexpected 'not' (T_STRING) in C:\wamp\www\phpacademy\MySQLi\Video 6_9\index_7.php on line 21 kev
  5. Hello IanA and bsmither.. Thank you for replying. There is no form, The tutorial exercise that I was following was a demonstration on how to insert records into a db via the url, the sort of thing an admin might do. This can be done at the C/: prompt but that wouldn't solve the problem that has arisen.
  6. I am attempting to insert data into a db via '?' in the url. The demonstration I've seen appears to work fine. I am using Wamp 2.2, Apache 2.2.22, PHP 5.4.3 and MySQL 5.5.24. My efforts merely take me off on a standard search. Has the global $_GET changed. My code. <?php //error_reporting(0); require 'db/connect.php'; echo 'Connected'; //Added to be sure to be sure connected if(isset($_GET['first_name'])) { $first_name = trim($_GET['first_name']); if($insert = $db->query(" INSERT INTO people(first_name, last_name, bio, created) VALUES ('{$first_name}', 'Garrett', 'I\'m a web developer', NOW()) ")) { echo $db->affected_rows; } } ?> After the file is initiated the idea is to enter into the url ?first_name=Whatever press enter, the file should run and at the same time update the db. What am I missing. kev
  7. kev

    if_exists

    Hello scootsah. The script is a piece of standalone script from a book turorial. I half guessed that the full path or something was missing but I wondered also if there had been some PHP change somewhere. By all accounts the book I have is a litany of minor errors most of which were waiting for me. The next example in line has the same problem but dealing with 'is_readable', 'is_writeable' and 'is_excecutable'. I will take it as a standalone script nothing will work as it is meant to. Thanks scootsah. kev
  8. kev

    if_exists

    Hello all. <?php $file_name = ("file_type.php"); if (file_exists($file_name)) { echo ("$file_name does exist."); } else { echo ("$file_name does not exist."); } ?> According to the source for this file the echo should have been: file_type.php does exist. Unfortunately the oposite happened: file_type.php does not exist. kev....
  9. Hello again Mahendra. I had another go at the 'extended setup' I compared Jon Lyles 'setup.php' against Smarty.net 'extended setup' I had to make one or two alterations and the thing worked first time. That's that sorted now to fix 'PEAR' Kev
  10. Hello again Mahendra. I found what amounted to a couple of typo's in my script for using Smarty extended setup and it now almost works. At a guess I would say this error is due to a problem with some sort of variation with the Smarty version that I am using and the version that Jon Lyle used, here is the error. Fatal error: Uncaught exception 'SmartyException' with message 'Call of unknown function 'Smarty'.' in C:\wamp\bin\php\php5.3.0\Smarty\libs\sysplugins\smarty_internal_templatebase.php:692 Stack trace: #0 [internal function]: Smarty_Internal_TemplateBase->__call('Smarty', Array) #1 C:\wamp\bin\php\php5.3.0\includes\guestbook\setup.php(18): Smarty_GuestBook->Smarty() #2 C:\wamp\www\guestbook\index.php(4): Smarty_GuestBook->Smarty_GuestBook() #3 {main} thrown in C:\wamp\bin\php\php5.3.0\Smarty\libs\sysplugins\smarty_internal_templatebase.php on line 692 Thans Kev
  11. Hello Mahedra. Thanks form replying. I had already used the setup and code from Jon Lyles blog and it threw out an error, this I corrected (more by accident than design) by removing from the "include_once" the 'SMARTY_DIR .' reference, it all worked fine after that. The interest now, after having success with the 'Basic' setup was to get the 'Extended setup' to function, I think Jon Lyle's code for this particular type of setup needs examining and maybe modifying to suit a newer version of Smarty. I have attempted to contact Jon Lyle but without success. I am a rank amateur at coding and would be grateful for your help. Kev
  12. Hello Mahendra. Thanks for replying. I have actually managed to get that far with the 'basic setup' from... http://ubuntu-linux-apache-mysql-php.blogspot.com/2009/10/how-to-install-smarty-with-wampserver.html What I'm now in conflict with is the 'extended setup' described on the same webpage, at the first try it's throwing out an error, but this might be due to using a slightly later version of Smarty than from the webpage, at the moment my version is 3.1.0. My problem is trying to get the concept and path into my head. Have a look at the page and tell me what you think and also how would it be modified for the latest stable Smarty 3.1.7. Kev
  13. I'm very bad at R.T.F.M. so I would be grateful if there's someone who could assist and help me to get Smarty installed on Wamp.
  14. kev

    Anuvver kev

    I'm off to a good start I seem to have lost a post, never mind. Thanks to whoever gave suggested a different publication, I will more than likely give it a bash. As someone who has more or less just walked in off the street I didn't find the book so bad, as far as I can get through it that is, it's just that it is frustratingly impossible to get help especially from the source. Getting stuck and thrashing around is irritating to say the least. Cheers all.. Slainte gizmo.
  15. kev

    Anuvver kev

    Hello I'm another kev, albeit an ancient one. I'm trying to learn php from a book 'Learning PHP & MySQL' it's from a reputable source. I read the appraisals some time after I purchased it ... not so good, bit like my coding. I am now stuck on a bit of php code that's causing me to lose momentum, but before I start posting what seems like reams of code I would like to know if there is anybody else who has been through the book and knows all the coding, especially the blog example using Smarty, PHP and MySQL. Cheers all.
×
×
  • Create New...

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.