Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
[SOLVED] Display name from one table based on ID of another table
Maq replied to TechMistress's topic in MySQL Help
Sorry, this will work... (you don't need the strtotime() method) $rows['project_start'] = date("n/j/Y", $rows['project_start']); $rows['project_end'] = date("n/j/Y", $rows['project_end']); -
Is there an error? Do you even have error reporting on? Was it ever working? That's a lot of code to not have it working at one point. What did you change. WE NEED DETAILS....
-
I assume you already have you form along with it's methods...? if(isset($_POST['subimt']) { echo ''; }
-
[SOLVED] Display name from one table based on ID of another table
Maq replied to TechMistress's topic in MySQL Help
Try this: $sql = "SELECT projects.*, categories.cat_name FROM projects INNER JOIN categories ON (projects.project_types = categories.cat_id) where 1"; $result = mysql_query($sql); while ($rows=mysql_fetch_array($result)) { $rows['project_start'] = date("n/j/Y", strtotime($rows['project_start'])); $rows['project_end'] = date("n/j/Y", strtotime($rows['project_start'])); //Should be project_end? echo ""; echo " ". {$rows['project_title']} ." ". {$rows['project_bids']} ." ". {$rows['project_types']} ." ". {$rows['project_city']} ." ". {$rows['project_state']} ." ". {$rows['project_zip']} ." ". {$rows['project_start']} ." ". {$rows['project_end']} ." "; } -
Sorry not too familiar with batch commands, have you tried system? system("SyncNow.bat"); Take a gander at this.
-
[SOLVED] Display name from one table based on ID of another table
Maq replied to TechMistress's topic in MySQL Help
Seems like you're using 2 different arrays... Where does $result[] come from? It should be: $rows['project_start'] = date("n/j/Y", strtotime($rows['project_start'])); FYI: 1228432870 is a timestamp. -
Hmmm, I see. kashthealien please describe your situation in a detailed manner so we can help you figure out a good solution.
-
echo exec("SyncNow.bat");
-
I can't think of a logical scenario to re-order auto-incremented id's... well,
-
OR:
-
The one that didn't work didn't work because you put it on the wrong place Yeah, he probably put it in the while loop. Anyway, they are both pretty much the same thing, and both should work. I see...I did put it in the 'while loop' Doh! Lol! This is what I meant... while($row=mysql_fetch_array($res)){ $title=$row['Title']; $pubdate=$row['PubDate']; $description=$row['Description']; $content=$row['Content']; $source=$row['Source']; } $pubdate=date("j F, Y",strtotime($pubdate)); echo "Published" . $pubdate;
-
The one that didn't work didn't work because you put it on the wrong place Yeah, he probably put it in the while loop. Anyway, they are both pretty much the same thing, and both should work.
-
It sure would be, but, you could always run a cron job late at night to dump and repopulate the tables. kashthealien, what is the purpose of this, if you don't mind?
-
Lol, I think he wants something a little more dynamic... The only way I can think of doing this is to dump your data to a temporary table empty the current one and repopulate the original table from the temp one. It will auto-increment everything back in order. But there's no way to INSERT a record and have it "fill in the gaps" of the auto-increment field, at least not to my knowledge.
-
Not sure exactly what order that would be but after you run your query you just use mysql_num_rows to return the number of results. I understand you need a query for a search in 3 fields: headline summary story but I'm lost in what kind of order you want them returned.
-
Have you tried: $pubdate = date("j F, Y",strtotime($pubdate)); echo $pubdate; ?
-
Back to your original question, after you grab the contents just utilize regex, substrings, etc. to grab what you need. You need to figure out the structure of how they display their content first. You may want to look up something similar to screen scraping.
-
You can set POST variables by doing something similar to this: curl_setopt ($ch, CURLOPT_POSTFIELDS, 'fieldname1=fieldvalue1&fieldname2=fieldvalue2'); Here's a snippet...
-
I have a function that is supposed to write/update a file and, if the user clicks on the checkbox ($use), rename the file. Everything works fine until it invokes the rename method. I've closed the file handle, changed its mode to 777, tried to delete the file and create one but still gives the same "Permission denied" error. Any ideas what could be causing this? Thanks. Error: Code: function updateFile($name, $ids_array, $use) { $myFile = (file_exists($name.".old")) ? $name .".old" : $name .".txt"; $newFile = ($use != "") ? $name.".txt" : $name.".old"; $fh = fopen($myFile, 'w') or die("can't open file"); for($i=0; $i{ if($ids_array[$i] != "") { $stringData = "$ids_array[$i]\n"; fwrite($fh, $stringData); } } fclose($fh); rename($myFile, $newFile); }
-
Are you using a reseller template? Could have sworn I've seen this same exact site before...
-
I have a short delay, less than a second...
-
Can you please: 1) echo out $query. 2) add or die(mysql_error()) to the end of your queries. 3) add this to the top of your script: ini_set ("display_errors", "1"); error_reporting(E_ALL); Not sure but I think you also need to do: if((awake+5) >= maxawake) {
-
1) Have no clue what you're asking. What do you mean change? You should be more detailed. 2) This has nothing to do with regex. Move this thread to the PHP Help thread.
-
One problem. The date() function returns the seconds but with the leading zeros. So, in some cases, you're going to have extra characters.