181 Posted Topics
Re: I tripped on this a few times myself, early on. As you have discovered, there's a strict order in which data are to be sent to the browser. Headers first, then the HTML. It isn't that 'the header has already been passed'; rather, it's that data [i]other than[/i] headers have … | |
Re: Check your ed script. I'll bet there is at least one space at the beginning of most of the lines, which happens when one copy/pastes from a web browser. The ed() commands should be at the beginning of the line. The solo '.' that indicates the end of new data … | |
Re: [QUOTE=juanki09;874760]...[CODE]$sql= "select * from PRODUCTS where Type="$Type" and Brand="$Brand" and Size="$Size" order by ProductID"); ... [/CODE][/QUOTE] This statement (as well as others like it) is not quite correct. Foremost, delete the close paren ')' at the end of the line. Next, you are concatenating strings, which usually requires the concatenation … | |
Re: [QUOTE=bettina702;874185]Hi, I want to update a specific field in my database. My database has only one row with one field in it. How do I overwrite that field? This is what I have at this point, but its not working: [CODE]mysql_query(UPDATE Table SET column = "$item" WHERE column = "1") … | |
Re: Each of your -exec clauses needs to be terminated with an escaped semi-colon, as in: [code] find / -name \*JPG -exec chmod 644 {} \; -print [/code] At least the shell and possibly find() are having trouble determining where the find's -exec command ends. | |
Re: [QUOTE=AirmanTheGreat;867353]Hello, I received a question whereby I had to convert to fractional decimals to binary. 0.28125 and 0,65625 Using the methods taught me to convert them to fractional binary I got .01001 and .10101 respectively. Next we were required to add the two binary fractions, which my answer was: .11110 … | |
Re: [QUOTE=saurav.prasad28;866463]... I need to sort out all B that only has CAPITAL letter inside the letter and the out put will be displayed like this A B "1" "SAntOsh" "2" "SAuraV" "5" "SAthiYa" Please help me out for this question :icon_cry: Thanks in Advance[/QUOTE] You need a regular expression. Something … | |
Re: Weird, but it can be done. [code] CUST_1=filename b=1 eval c=\$CUST_$b echo $c [/code] There may be easier ways to do what you mean, like using an array. But this works, and gets points for being 'clever'. | |
Re: In order to relate two tables of information, you need a value that ties them together, a value that is the same in each. If you give each company in the CompanyName table a unique ID, you then store those ID values in the ShareRate table with records containing containing … | |
Re: MySQL has a migration toolkit available; I think it is part of typical distributions. See [url]http://dev.mysql.com/doc/migration-toolkit/en/index.html[/url] for the documentation. Try [url]http://forums.mysql.com/read.php?60,27738,27738[/url] for good leads on how to accomplish what you want. I've used this toolkit to migrate a Win/Access database to Linux/MySQL. | |
Re: [code] IT WAS TRUE 25 HYPHEN 30 YEARS AGO AND IS STILL TRUE TODAY COLON TALK TO THE BEAR FULLSTOP COLON RIGHTPAREN IF YOU DON APOSTROPHE T UNDERSTAND SOMETHING COMMA SPEAK OUT LOUD SEMICOLON THE ACT OF TALKING SLOWS YOUR THOUGHTS AND FORCES YOU TO ORGANIZE THEM FULLSTOP# THAT SAID … | |
Re: May I suggest keeping all numbers as true numbers? Only convert them to formatted strings when you display them to the user. You might be mixing numbers and strings in your arithmetic operations--strings don't always convert nicely to numbers. :) | |
Re: [QUOTE=nadineatwaroo;858899]...I have a db in sql server with some large tables and I would like to transfer the entire db from one server to another server without having to create the tables and so on. Is this possible?[/QUOTE] It would seem to be possible. Use the BACKUP command to make … | |
Re: [QUOTE=sandeep_more97;853833]... i. e. i want to send FORM data to two different pages. [code] document.form.action = 'xyz.com/order/email_order.php'; document.form.submit(); document.form.action = 'https://www.paypal.com/cgi-bin/webscr'; document.form.submit(); [/code] Its working fine in Mozilla but not in other browsers..... Or Is there any other solution?? ....i dont want 2 submit button.[/QUOTE] You should go to PayPal's … | |
Re: Slightly outside my normal realm; I rarely (almost never) use perl. However.... "perl -w ..." is your friend. It'll show you a lot of stuff that's normally 'hidden'. Such as it appears that filehandles need to be UPPERCASE. The second script needs to use the same IP address the listener … | |
Re: Of course there is. Don't be ridiculous. :) :) [code] #! /bin/sh typeset -i i typeset -i imax i=0 imax=1000 while [ $i -lt $imax ]; do mysql -e 'insert into mytable set mycol='myval' i=i+1 done [/code] Adapting it and making it work for you is your job. :) :) | |
Re: [QUOTE=externalaw;840118]Sorry yes, in a text file. Then I can export my database to excel and cut and paste the two columns into there, and import it back into phpmyadmin, a total noob way of doing things I am sure! Mike[/QUOTE] I think it would be easier to write the shell … | |
Re: [QUOTE=lehe;837950]Hi, Here is my code, [code] ids=(1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 90 100 110 120) for ((i=0;i<${#ids};i++)); do awk '{ print ${ids[${i}]}" "$1; }' > ${TMP} < ./results/$1${ids[${i}]}/test_error.dat done [/code] I got this error if I changed awk … | |
Re: You seem to be right; awk/gawk do seem to have limited REs. But I do have a wiseacre solution. :) [code] alias awk=egrep awk "^.(.)\1" emp.list [/code] | |
Re: In short, "WHERE field=value", you should have "value" inside single quotes ('). I stubbed my toes on this many times until I learned to put the value in quotes. Unless it was a function, of course. | |
Re: Why's it work? Matter inside double quotes (") is interpreted/evaluated by the shell. Matter inside single quotes (') is not. It's a handy tool, but can cause some stubbed toes along the way. :) | |
Re: [code]/usr/ucb/ps -auxxx | awk '{printf("%4s %4s %5s %4s %s\n", $3,$4,$2,$1,$11)}' | grep -v 0.0[/code]probably does what you really want: line up the columns. If you truly want the numbers to be %5.2f format, you'll need to treat the column heading line differently. Another option that might work:[code] ps -eo '%cpu … | |
Re: Perhaps the '!' and the '[' should be swapped. Usually the 'not' works better if it's part of the test. :) Of course, shell scripting has become somewhat, mmm, different in the past 20 years, so it might just work the way you wrote it. | |
Re: [QUOTE=rEhSi_123;818997]... Right well got the serachphrase working,,,,,now the issue is I want the searchphrase to be contained in double quotes if it contains spaces or have each space preceded by a backslash. Any help with this????[/QUOTE] In shell programming, ensuring that arguments are properly quoted is an exercise left to … | |
| |
Re: To strictly answer the OP's question: [code] LOCK TABLES active WRITE, archive WRITE; INSERT INTO archive SELECT * FROM active WHERE active_rec_id='$confirmed_id'; DELETE FROM active WHERE active_rec_id='$confirmed_id'; UNLOCK TABLES; [/code] The LOCK and UNLOCK are shown in case you want/need 'atomic' updates. This worked for a simple table. It might … | |
Re: [QUOTE=lifeofapirate;792151]You folks are really helpful and knowledgeable. I wish I knew as much. I'm just a humble DreamWeaver user. Don't laugh. Well, okay you can. Where would I go to learn this stuff?[/QUOTE] You would go home and reference the same resources I did:[list][*][url=http://www.w3.org]HTML and CSS specs[/url] [*][url=http://www.php.net/manual/en/index.php]PHP Manual[/url] [*][url=http://dev.mysql.com/doc/#refman]MySQL … | |
Re: Considering that translation/interpretation is usually one-to-many, you might be better off with option 1, where you have your vocabularies cleanly stored in the two language tables and your third table defines the relation (translation/interpretation) between the languages. This would also make it easier (in a manner of speaking) to add … | |
Re: [QUOTE=architact;777350]Hello, I am developing a website but I am stuck at a point. I have a table having Sundays, video, and photo1, photo2, photo3 as columns. I have a form on a web page having three check boxes "with videos", "with photos" and "Open on Sundays", I want to get … | |
Re: [QUOTE=ntman4real;782499]... Any ideas of how I can declare the users input as a unique variable each time and then store it until I calculate at the end? [code] #!/bin/bash ... for (( c=1; c<=3; c++)) do read -p "Please insert Grade #$c:" GRD$c LetterGrade $GRD echo done ...[/code] [/QUOTE] One … | |
Re: Without the backslash, the shell checks to see if there is an alias for the command. If so, it uses it. With the backslash, the shell skips this check and runs the first version of the command that it finds in $PATH. N | |
Re: Half of programming is learning to be an able toolsmith. :) If no such tool exists, you'll have to make your own, perhaps using a pair of existing tools: sed and m4:[list][*]sed() transforms the input to a form m4() can understand[*]m4() 'replaces' the macros with suitable PHP code. But then, … | |
Re: 'index' is a reserved word. You must name that column something else. | |
Re: Clients never reference cases or invoices. Invoices can be related to many clients. Invoices can be related to many cases. Cases can be related to many clients. Cases can be related to many invoices. So:[list][*]Clients, cases and invoices never reference each other.[*]Case relations reference many clients.[*]Case relations reference many invoices.[*]Invoice … | |
Re: [QUOTE=jhatter;774612]... If I view it online, on a Mac in Firefox everything appears OK. If I view it in Safari from my hard drive everything appears OK. But If I view it online, on a Mac in Safari the link text "Enter Flash Site" is larger and in grey! If … | |
Re: [QUOTE=BHance;773256]Thanks for the response robothy, I should have stated my problem a little more clearly. The problem is that the script timeouts before the whole set of data is finished. Also, if I try entering the data in one long query, mysql timeouts. The most efficient way I have found … | |
Re: [QUOTE=finance-blog;770714]I have a query that gets 5 random values out of a table according to a query. i.e. [code=sql]SELECT * FROM links WHERE url contra = FALSE ORDER BY rand() LIMIT 0,5[/code] This is fairly simplified but you get the idea. One of the fields in the table is ip, … | |
Re: I don't know if there is anything built into MySQL to do this. It's been a while since I've had to 'track' autoincrement values, but that's where you can look. But you can get close using autoincrement. Basically, you create a table where the question_id is an auto-increment value. You … | |
Re: It's all about perception and interpretation. Think of the world of software as being entirely virtual. Said slightly differently, a physical representation of software is simply a translation to that medium. If you print your C source code on paper, you are translating your source code to ink on paper; … | |
Re: The only thing I can think to try is to find exactly where the .bat file is created and remove 'DELETE' privilege from that directory for all users (via Properties, Security tab and Advanced button. That *might* prevent the program from deleting the .bat script. Or rename cmd.exe to cmd-real.exe … | |
Re: [QUOTE=Blackeagle;764342]yeah i want to delete the line with word green. your command did work well but it doesnt change the original text file, it rather sends the new edited text to the newfile. is there any way i can change the same file i'm using and save the cahnges? and … | |
Re: The following may be closer to what you want: [code] lsof | grep QuarkXP \ | cut -c76- \ | sort | uniq \ | awk '{ printf("\"%s\"\n", $0)}' > /tmp/output1 [/code] The cut(1) deletes everything but the filename. Awk then prints the quoted filenames to the output file. To … | |
Re: You're on your own for accessing the MySQL server. The following statements usually work for creating databases and tables: [code]create database; use; create table a (field1, field2, ..., key);[/code] Download the MySQL manual (PDF) and peruse the syntax of the aforementioned statements. I taught myself MySQL by RTFMing, though I … | |
Re: [QUOTE=johnwayne77;764050]... i have a prepay online store and i advertised a contest to win a free code when buying at least 5 codes during 24.11-24.12 2008 period. ... any ideas?[/QUOTE] This is pseudo-codeish so you have to RTFM and google to make it work. :) You need to use count() … | |
Re: [QUOTE=confusedGirl;763306]As a beginner, I designed a website using php, but unfortunately I found difficulty with 3 codes. I have already written them but am not sure why they didn't work ....[/QUOTE] I'll remark on the first proggy. A few obligatory questions. How is the status getting from the browser to … | |
Re: [QUOTE=jagr200;761666]hey all. Im writing a small script that is supposed to check for a file or directory and when its not there create it. After it creates the file or directory I would like the script to loop to the beginning but I cant figure it out. What am I … | |
Re: This problem isn't necessarily intuitive, but can be solved by looking at how shells handle pipelines: they exec the last things in the pipe first. Unlike human society, unix/linux/posix speakers (writers) suffer a horrible fate if they speak when there are no listeners (readers) unless, of course, the speakers (writers) … | |
Re: bc(1) is your friend. It computes to arbitrary precision. "-e" tells bash to interpret \x sequences; ksh might not need it. [code] . . . integer read=`echo -e "scale=2\n$rBytes/1000000" | bc` integer write=`echo -e "scale=2\n$wBytes/1000000" | bc` . . . [/code] | |
Re: [QUOTE=ggeoff;734601]... The proposal is that a couple of old drives can still be used with little risk ...[/QUOTE] A seven year old disk drive? I would trust it to be useful for testing and for educational/training purposes. But given a choice between using old drives for my system and data … | |
Re: [QUOTE=f.ben.isaac;734559]I'm wondering, if compilers are written in human readable way, then how come the machine could read the compiler? If machine could read the compiler - which is by itself is not a machine language, why don't the machine just read the high level programming language directly? As it is … |
The End.