| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Comments:
<0> ha? No. <1> jamey: Uncomment/add extension=sqlite.so in your php.ini file and restart apache <2> MarkL, it is uncommented, I checked. phpinfo() returns /etc/php5/apache2/php.ini as the location, which is correct. <1> jamey: Does a <?php phpinfo() ?> page show a sqlite section? <2> MarkL, no it doesn't which was my first port of call - "dbx" has SQLite listed in its supported databases but I doubt that's of any help. I'm guessing sqlite.so never gets loaded but it's referenced and exists... <1> jamey: It's worth stopping apache, making sure there's no apache processes still running (kill -9 them is there are), starting apache and also clearing your browser cache just to rule that out as a problem. <3> because i use $_POST['Appointments'] which value Appointments suppose to be?? The name of the list box the id or the value? <3> im confused <4> hi <2> MarkL, I stopped and started Apache and then did a 'force-reload'. SQLite has popped up in phpinfo() and my script now works! Thank you :-) <4> if I have a function that prints some string <4> cand I caputre its output? <3> i understood that but if i change them what the $_POST['Appointments'] should be? Is it gonna be the name i give in the list box or the value? <4> with ob? <1> Cambridge13: With <select name="foo"><option value="bar" ... $_POST['foo'] would have the value bar
<3> soz <1> ldas: Yeah <4> cool <3> so in the $_POST[' '] i put the value of the <select name> not any other value <3> right? <1> Cambridge13: yeah <3> let me try that <1> Cambridge13: If you're ever unsure just do a var_dump($_POST); to see what's in there <5> i insert Joo to bd, in phpmyadmin i see Joo <5> is normal? <3> where should i write this var_dump... <3> ? <1> Cambridge13: Usually at the top of the script you post to inside something like, if(!empty($_POST)){ echo '<pre>'; var_dump($_POST); echo '</pre>'; } <6> hello <0> yes <6> to have ssh functions in php, i need to compile php with libssh2 support or is there a way to load the support after php is installed? <1> symtab: http://php.net/ssh tells you how to do it without a recompile <6> MarkL: thanks <3> Undefined index: Appointments <3> i dont know why the query does not work. <3> maybee i need to play around with the quotes <1> Do you have <select name="Appointments"> ? <3> yes <3> it always gives me the same error <1> Do the var_dump thing and see what's in there <3> is it gonna return the contents in the web page then? <1> It's going to return the contents of the $_POST array, i.e the stuff you submitted <7> Hi guys. Is it possible to make a link in an iframe that refreshes the whole page? <3> ok i got them. but i need to figure out what is each one <1> Kernel_burner: Tried using target="_top" ? <7> ok it works. Thanks alot! <1> np <3> check this http://hashphp.org/pastebin?pid=6690 <3> uuff it didnt post it .ita gave me a server error <3> sorry i will post it again <1> Cambridge13: <option value='FreeHours'> .. that inside your loop will give every option the same value <3> http://hashphp.org/pastebin?pid=6695 there u go <3> so how i will print the data of the table? should i only move the <option value='FreeHours'> out of the loop? <1> Cambridge13: Depends, what value would you like to get? The VetName, FreeHour etc? Should be a unique value <6> /usr/local/bin/phpize: /tmp/tmpWvImDi/ssh2-0.10/build/shtool: /bin/sh: bad interpreter: Permission denied <6> Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF <6> any ideas how i can fix this <6> ? <0> install autoconf? <3> yeah but each value of the list box (each entry) consists of three things: FreeHourID, VetName Day and Time which are taken from one table through an array <1> Cambridge13: You want to know which one they selected, so which field in the db can you use to identify the one they selected? <0> !tell Cambridge13 about u <3> i guess the FreeHourID <1> Cambridge13: Ah, you need FreeHoursID? <1> So use, <option value='".$row['FreeHourID']."'> <3> outside of the loop?? <1> In the loop <3> ok let me see <1> That will give each option a unique value <3> aha <8> if a constructor fails to fully create an object what is the Approved Way(tm) of returning that error? <8> in php 5 <1> "An object will always be ***igned when creating a new object unless the object has a constructor defined that throws an exception on error." <8> well, that's simple enough <8> thanks <3> ok now it reads the FreeHourID
<3> but the query does not delete it <4> how do I access a variable from outside a cl***? <4> is there something like ::$var? <3> should i change '" . $_POST['Appointments']."' with '" . $_POST['$row['FreeHourID']."' ?? <1> no <1> Just debug it: <1> $sql = 'DELETE FROM FreeHours WHERE FreeHoursID =' . $POST['Appointments']; <1> $delete = mysql_query($sql) or die(mysql_error()); <9> ... <9> that's how i usually write my code :S <3> yes i have already debug it. it gives me the error query failed <1> ldas: You probably shouldn't be accessing variables outside the cl*** <1> Cambridge13: You need to know why it failed, the exact error <4> uhm, I'm making a testunit and I need access to db connection vars <3> it doesnt say no. Before it ws saying that Appointments was undefined. Now it only gives me the data sent from the $_POST and then the message query failed <1> ldas: Have your db cl*** return an instance and use $db = DB::getInstance(); for example in your cl*** <1> Cambridge13: That's why i posted the code above, it will tell you exactly why it's failing <4> let me see what I can do <4> thanks, good idea <3> it worked <3> ii had a syntax error <3> now i dont want the var_dump($_POST); to display the info. is it ok to remove it? <1> Cambridge13: Yeah <3> Thank you very much mate. I will continue and if i have another problem i hope i will find you in here <1> np <3> is that query correct: $insert = mysql_query("INSERT INTO BookedHours VALUES ('" . $_POST['Appointments']."')") <3> now i want to insert the posted data (which were deleted from the other table) to another table <1> Cambridge13: No, unless BookedHours only has one column <3> Booked Hours is exaclty the same table with FreHours <1> Cambridge13: INSERT INTO BookedHours (columnname) VALUES ('whatever') <3> they both have the same fields <1> Cambridge13: But you need to tell it which column you want to put the value in <10> Morning <4> Singleton::getInstance()->dbHost; <4> it works :D <1> Nice <4> thanks again <1> np <11> i dont suppose anyone knows of any good frameworks that have support for hierarchical groups in the authentication? <2> I'm trying to compile PHP 5.1.4 on Ubuntu but I keep getting this make error: "make: *** [sapi/apache2handler/mod_php5.lo] Error 1". I've installed the apache-dev package which included apxs(2)... how can I fix this error? <12> hey everyone <1> jamey: What's the error that comes before that line? <12> I'm getting a very strange error, whenever I purposely generate a parse error in my script, the whole script just dies without giving me any error output <10> guzzlefry: you check your error log? <2> MarkL, /home/jamey/php-5.1.4/sapi/apache2handler/mod_php5.c:36: warning: initialization makes integer from pointer without a cast <1> guzzlefry: Check the values of error_reporting and display_errors in your php.ini file <12> lig: where would the error log be located? <13> whats a good website and/or book to look at to learn php/mysql to build professional websites <10> guzzlefry: check the php.ini or phpinfo - it should tell you there <2> MarkL, maybe this line is relevant? /home/jamey/php-5.1.4/sapi/apache2handler/php_apache.h:29: error: previous decla ration of 'php5_module' was here <1> jamey: Hard to say without seeing the full output of make, maybe post it somewhere? <12> error_log has no value, and logging errors is disabled... <10> guzzlefry: follow MarkL's advice then... check your error_reporting and display_errors <12> it is E_ALL ~ E_NOTICE <12> I just found out that it does report parse errors on a quick little script I wrote, but not on the project I'm currently working on <1> guzzlefry: Check your project doesn't override those ini settings with error_reporting() or php_value settings in a .htaccess file <12> I'm sure it doesn't <1> guzzlefry: Change php.ini to use just E_ALL then, that's usually the best option anyway ;) <12> but then I get the annoying undeclared variable errors :-( <3> Ok i know why the $insert query does not work: First of all the two tables FreeHours and BookedHours have the same fields:FreeHoursID and BookedHoursID respectively (both auto_increment primary keys) VetName, Day and Hour. <3> When i say delete for FreeHours everything is fine. But when it comes to insert the deleted stuff to the BookedHours table it has to insert the FreeHourID into the field with the BookedHourID which is not able because of the two primary keys conflicting. Am i right? <1> So declare them and have nice code ;) <12> what user does PHP run as usually? <1> The web server user, usually apache, httpd or www-data <1> (sometimes nobody) <12> ok, thanks <1> guzzlefry: httpd.conf will tell you <3> Because the BookedHourID has to increment but there comes the FreeHourID to get in his place. right? <1> Cambridge13: Sounds like a database design problem. You shouldn't really be deleting from one to then insert it into another, and especially not using the id from one table as the id for another :o <13> could someone suggest a good site or book to learn not only the basics of php development but gives you a full instruction on more advanced topics as well? <1> JJPeerless: Book - 'Advanced PHP Programming' is good <13> will that also cover basics of PHP..im not new to programming as im a cs major at uni and know c/c++/java very well <13> just want to learn php
Return to
#php or Go to some related
logs:
foxx_ #ubuntu #suse #css #debian #lgp #perl what is emoviex fluxspace compile #css
|
|