dabaR
Members-
Posts
189 -
Joined
-
Last visited
Everything posted by dabaR
-
Interesting, I did not know, there totally is one in the Microsoft SQL server's SQL implementation, so I figured there would be one in MySQL. This page talks about that, maybe that would help: http://www.electrictoolbox.com/article/mysql/cross-table-update/
-
Hi there. Make a iterates over each letter "l, lo, lob, lobs..." that keeps a previous_iteration_results and a obtains a current_iteration results. As soon as there are no matches in current_iteration_results, you return previous_iteration_results.
-
Hi there, I would probably do $row_exists = db_query("SELECT CASE WHEN EXISTS(SELECT * FROM profile WHERE id = " . db_quote($id) . ") THEN 1 ELSE 0 END"); if ($row_exists) { db_query("UPDATE state_licenses SET selectStates = profile.stateLicenses, selectSecondary = profile.additionalLicenses FROM profile WHERE state_licenses.id = profile.id AND profile.id = " . db_quote($id)); } else { //insert, you know that one. } It's called an UPDATE...FROM
-
You could. Here is what the manual says:
-
Yes. You can write if(!empty($d) && !empty($f) ...). See more here: http://ca2.php.net/empty
-
see if any of the links here help. If you have further questions, let me know. http://www.google.com/search?client=ubuntu&channel=fs&q=php+mysql+stored+procedure&ie=utf-8&oe=utf-8
-
have there been any changes to the linked servers configuration?
-
Are you today using a different input file than you were yesterday? If so, can you try with the file that worked yesterday?
-
Need to create text file for photo descriptions
dabaR replied to bschultz's topic in PHP Coding Help
Well, you probably want the echo $file_names[0]; echo "<br />"; echo $file_names[1]; outside of the while loop to start. -
It means any whitespace. * " " (ASCII 32 (0x20)), an ordinary space. * "\t" (ASCII 9 (0x09)), a tab. * "\n" (ASCII 10 (0x0A)), a new line (line feed). * "\r" (ASCII 13 (0x0D)), a carriage return. * "\0" (ASCII 0 (0x00)), the NUL-byte. * "\x0B" (ASCII 11 (0x0B)), a vertical tab.
-
Need to create text file for photo descriptions
dabaR replied to bschultz's topic in PHP Coding Help
<?php $dir = opendir ("."); //code changed to use current directory $file_names = array(); while (false !== ($file = readdir($dir))) { if (strpos($file, '.gif',1)||strpos($file, '.jpg',1)||strpos($file, '.JPG',1) ) { $file_names[] = $file; } } ?> -
Need to create text file for photo descriptions
dabaR replied to bschultz's topic in PHP Coding Help
Yes, I meant to use $file_name there. Well, what kind of an array can be used in the form field's? <-- grammatically incorrect, BTW. -
And what about running the same query directly in mysql? If that works, you might want to post some of the code you cut out, cause there don't seem to be many errors in that code shown.
-
Need to create text file for photo descriptions
dabaR replied to bschultz's topic in PHP Coding Help
Oh OK. <?php $dir = opendir ("/my/directory/here"); $files = array(); while (false !== ($file = readdir($dir))) { if (strpos($file, '.gif',1)||strpos($file, '.jpg',1)||strpos($file, '.JPG',1) ) { $files[] = $file; } } foreach ($files as $file_name) { echo $file; } ?> -
Can you just use http://ca.php.net/manual/en/function.chmod.php ?
-
Hah. I totally thought June was the sixth month too. But then again, $a[5] is the sixth element of $a. Sometimes strtotime does not work as you would like it to. The link Ignace pointed to is really good. I came up with this example: <?php echo date('Y-m-d', strtotime('second thursday', strtotime('June 2010'))); ?>
-
Well, that code would not compile (missing } for while loop), but it looks like it would display all results, and the SQL seems to get all the transactions with that tfid. Can you double check by running the same query right inside mysql?
-
Hi there. Ya, basically you were on the right path, if not all the way there... See example code here: http://codepad.org/rWLr4v9E
-
Need to create text file for photo descriptions
dabaR replied to bschultz's topic in PHP Coding Help
Hm...I'm working on a similar thing. I decided to not provide any of the features you are building. I would be interested in seeing the code once you are done. To make a form, you can't possibly echo $file[0]. $file is a string, $file[0] means first character of $file. You have to echo <form....><input type="text"... /></form> Am I missing something in your question, or are you really asking about basics of HTML forms? -
How to split a string cleanly into at most 2 strings
dabaR replied to hadoob024's topic in PHP Coding Help
Doesn't matter in terms of splitting it into two parts....if you need to scrub out characters, then you might need str_replace(). -
How to split a string cleanly into at most 2 strings
dabaR replied to hadoob024's topic in PHP Coding Help
So then you might want to use a character other than \n in the wordwrap/explode calls, like KingPhilip suggested. Even Something super weird, like a password. {}++_FGShc@, you know? -
Oh, you can also print_r($_FILES), maybe that will help.
-
Is this your own server? Can you check that display_errors is on? http://php.net/manual/en/errorfunc.configuration.php Do you generally get errors when you make a syntax error in your code?
-
How to split a string cleanly into at most 2 strings
dabaR replied to hadoob024's topic in PHP Coding Help
Is the string even going to have a \n on its own? In that case you get 3 strings, or 2+however many "\n"s there are in the string, right? -
How to split a string cleanly into at most 2 strings
dabaR replied to hadoob024's topic in PHP Coding Help
Hehe...noone can critique code they don't see :-P (post the code)