| |
| |
| |
|
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> just want to learn php <1> PHP for Dummies :P <1> PHP and MySQL* <2> JJPeerless: Yeah, it says 'Advanced' but it's a good alround book for PHP5 <3> I like that book on hudzilla.org, for a reference anyways <0> ok cool <1> You might also like PHP5 Unleashed from Sams publishing. <0> how about some guide online for setting up a little "test" site or something hosted on my own computer <0> just to see the code i write work <0> instead of buying hosting for testing purposes <2> The PHP install guide should cover that ok <1> Umm... I know of this free host FSPHost <2> JJPeerless: Or just use something like XAMPP <1> Just got it yesterday, 250MB, don't know if it has PHP support, but it looks like it has Apache <4> How can i exclude the FreeHourID from inserted in the BookedHours table? I mean exclude it from the $_POST['Appointments'] when it comes the $insert query. Can i choose what to be inserted form the $_POST['Appointments'] ?? <1> JJPeerless: If you have a Linux box, you can do the LAMP [Linux Apache MySQL PHP]
<2> Cambridge13: You insert whatever values you choose, nothing is forcing you to use the FreeHourID <0> hmm i have Linux set up on vmware <0> maybe ill look into LAMP <1> JJPeerless: If you don't, well, it depends on how badly you want to learn PHP. <1> It's not called LAMP, it's just a mnemoic of sort <1> But yeah, recommend JSPHost. <5> JJPeerless: you can still install the AMP stack on M$... just follow the installation guides <1> FSP* <0> ok <1> Recommend apache2triad if you want dev on Windows <1> PHP * not dev <1> Includes the PHP, MySQL, Apache, and a crapload of other stuff <1> Want link? <0> yes please <6> I recommend installing each package seperatly because you'll learn more from it. <1> Um, allowed to post link, Ops? <2> yeah <1> CyaNox has point. <4> Can i say: INSERT INTO BookedHours (BookedHourID) SELECT VetName, Day, Hour FROM $_POST['Appointments'] ? <2> Cambridge13: http://dev.mysql.com/doc/refman/5.0/en/insert-select.html <1> I found that a pain for me. But that's becuase I was impatient. <1> And we know that impatient programmers aren't very good ones :P <1> Well, maybe that only applies to me. But whatever. <0> well ive set up apache on my computer before <6> Cambridge13: you just did ... :p ... but to not be funny ... but it you have a great opertunity for SQL Injection there. <0> and have made/managed my own mysql databases <7> mew! <0> and also coded little bits of php <8> :) <0> so im not totally new to al lthis <7> <?php phpinfo(); ?> <1> JJPeerless: so what's your question? <0> not a question, just saying i probably dont need to go through the h***le of setting up each individually <0> i can just use taht package your linking me to <4> i understand but i dont want to insert values from another table. I want to insert SOME values from $_POST['Appointments'] which contains many values. <8> kittyanya: You'll have to wait like 20 more minutes for outline of page 10... <7> okie dokie <7> I'm coloring Goatee's new site layout right now <3> ok, E_ALL is now on, PHP is logging errors to a file, but the script is still dieing and not giving me any output <2> Cambridge13: But $_POST['Appointments'] is a single select box, it will only have 1 value or just not be set? <3> wait a second...what does @ do in front of an include_once('file);? <2> Suppresses errors <0> ShuaiKing: pm me the link <3> haha, I feel stupid now :-) <4> We set before the $_POST['Appointments'] to be a select box which contains 4 fields from a table in only one row (array). <2> Cambridge13: No, it contains the value from <option value=" ... "> .. the bit between the <option></option> tags isn't posted .. only displayed <2> Cambridge13: You shouldn't need to post all that info anyway, the FreeHourID should be all you need to post as it uniquely identifies the row in the table <4> thats what i post. only the FreeHourID <2> Cambridge13: And that's right .. it's the only value you need to post <2> " I want to insert SOME values from $_POST['Appointments'] which contains many values." .. so that's why that is incorrect, it only contains one value <4> Ok, now i want to say : insert the value you deleted (which is the values of $_POST['Appointments'] to another table <4> the value sorry <4> not values <9> i am having an issue with variable scope. I have a variable defined before i include a file, if i try to print the variable from that file it does work, however i can't access to this variable from the function in the included file, even if i use the global keyword. The function are called from the parent file. Anyone has an idea of where the problem could come from ? <2> Cambridge13: So use $_POST['Appointments'] .. though what use that value will be in another table i don't know as there's no matching row to go with it, you just deleted it ;) <10> hmm, that kind of thing works for me - I'll define a $config obj and include a library, and use global $config in the library functions. <11> is anyone familiar with packages like PHP nuke? <10> loiic: i'd check the global is available just before calling a function using it first <11> i know they have a modules system, but do they implement that with like "require()" calls in PHP, or something else? <9> Xyphoid: everything is available at any moment, i checked on every single line
<12> I'm encountering an odd problem with PHP. If I fopen a JPEG, read all its data, and write it back, without editing it, the resultant file is about three times larger, even though nothing was edited. why? <2> NeoThermic: You mean read it's exif data? <12> wait <12> just reading all its data, ala $image_data = fread($handle, $filesize); <12> and then writing $image_data back into the file <9> i am sorry to insist, but anyone already got that kind of scope issue ? <9> i am setting the variable from an advance depth of function already, do i need to do anything special to enable the variable to be called as a global variable from a depth+1 point of view? <10> well, not a clue - a very similar arrangement has always worked for me <10> oh <8> kittyanya: storm.homeunix.org/misc/bts/page10_o.jpg <10> you're setting it in a function then calling it with global in a deeper function? are you using global in the first fn? <9> didn t work when i tried to call global in the first fn :/ <10> if you go f1() { $var = 1; f2(); } f2() { global $var; echo $var; } you won't see $var <10> but if you go f1() { global $var; $var = 1; f2(); } f2() { global $var; echo $var; } it should work <8> kittyanya: Um... It's only outline... <8> note the _o there :) <7> Stormchaser: yeah, but when I see it, I start working my brain what the coloring/dialog is gonna be =D <9> Xyphoid, the problem is calling global reset the variable, and at this point it is already set up ... <12> Stormchaser: you've any idea why this code is bloating files for no reason? <10> calling global should not reset teh variable unless you're overwriting it in that function <9> its a template engine so i unfortunately dont know the name of the vars at this point :/ <2> NeoThermic: Can you pastebin it as it doesn't sound like standard behaviour <8> kittyanya: but you never guess, anyways :) <9> the first global reset it Xyphoid, the one in the same level than the variable. <13> MarkL, sorry about that, I scrapped compiling and just got the latest binaries from dotdeb. <2> jamey: np <10> loiic: well, post your functions on pastebin I guess <10> are you doing $var = somehting; global $var; or something like that? <10> that's the only way I can think that global will 'reset' a var <9> kind of <12> MarkL: sure, one sec <10> do global as the first thing you do <10> in the function <9> but it s doing something similar <9> i cant ... <13> I'm trying to write a function that counts the number of occurences of a particular day in a specified month and year. For example, it could find the number of mondays in May 2006 and will return either 4 or 5. Any ideas? <9> the variable are extracted from an array, and i dont know the name of the variables at this point, because its a template engine, and this function is blind <12> MarkL: http://phpproblems.pastebin.com/717750 <14> ... <15> guys, lets say i have a form on a page, and i have a command button to save the form values to a table... now lets say i have a second command button and when pressed it would fill in 1 of the textboxes in the form with $var which is returned from a php function, is this possible? if so whats the best way <12> MarkL: if you need the exact file I'm working from, its here: http://www.neothermic.com/testing/DSCN2040.JPG <2> NeoThermic: So you're writing the data back into the same file .. appending it onto the original data? <10> loiic: ung, global sounds like a bad tool for this <12> MarkL: nope, I truncicate the file to start <12> which I forgot to copy into that pastebin <12> http://phpproblems.pastebin.com/717752 <12> thats the correct version <12> I removed some code between that which doesn't relate to the problem :P <12> the original file is ~600KB <9> Thanks for your help Xyphoid, i got it working! <12> after running that code on it, it becomes 1.8MB <2> NeoThermic: See if using fseek($handle, 0); after the ftruncate call helps <16> If i declare a variable within a function, how can I make it available to the rest of a script after the function has been called and executed? <7> Stormchaser: you have a face in your URL :P <2> brohism: Do $var = ''; outside the func and use global $var; $var = 'whatever'; inside the func <12> aha! <9> in now include the template before i extract the variables, the template file know which are the variable name and define them as global, the template engine then extract the variable which have been set up previously, and i can finaly access to those variable from the function in the template file. <12> now, run why that worked by me quickly? <2> NeoThermic: See the first note at http://php.net/ftruncate <12> oh, well I'll be <12> hehe <12> thanks very much MarkL, I was going insane trying to work out why on earth the image was huge after doing nothing to it <2> np <12> now I can go back and work out why the rest of the code doesn't work ^_^ <2> ;) <4> do you remember the <option value='".$row['FreeHourID'] in the beggining? Can i put a second value after the FreeHourID?? So i $_POST two values? <17> what kind of speeds are good for my DSL provider? I'm getting 1.2 down and 350 up <18> swimrr, depends on a few things.. this is not the channel to ask that sort of question. <2> Cambridge13: You could hack something up but I'd just use FreeHourID alone as it's unique and identifies a row in yor table. If you need more info from that row after posting just use another select query to get it <7> swimrr: quit channel hopping and asking :P <19> swimrr 1.2mb/s or 1.2Mbit?
Return to
#php or Go to some related
logs:
Can not call constructor php #php printing reserved characters in awk #ubuntu ubuntu r1000 deb #suse #asm #css #css remote desktop process rdp
|
|