Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
$sub = mysql_query('SELECT City, CLSfolder FROM $DBTABLE WHERE (Active="Y") AND (State="' . $row['State'] . '"'); In order for $DBTABLE to interpolate you need to have the string in double quotes. $sub = mysql_query("SELECT City, CLSfolder FROM $DBTABLE WHERE Active='Y' AND State='{$row['State']}'"); You don't need parentheses around each condition unless you want to specifically group them. Which, in your case, you don't need them. The curly braces around the associative arrays escape the single quotes.
-
Sorry if I came off a bit rude, that wasn't my intention.
-
Maq* Yes, they are merely warnings, which should be fixed, but error_reporting should be turned off on production anyway and set to max during development.
-
Without access, there really isn't any other way... cURL or file_get_contents and regex or an xml parser. Yes, I know. Again, without access to their information that's a risk he'll have to take. It all depends on their structure. Most likely you're going to have to use cURL.
-
Never ceases to amaze.
-
It's hard for us to help with that sort of query and not even knowing what you want. You can echo out your query to ensure it's what you intend: $sql = "SELECT * FROM e_result WHERE EXISTS ( SELECT `points` FROM e_pointscale WHERE e_pointscale.c_group=$c_group AND e_pointscale.place = e_result.rank ) and c_id=$c_id ORDER BY rank"; echo "QUERY=> " . $sql; $result = mysql_query($sql);
-
Clicked "My Profile", and received the following warning: Warning: Missing argument 1 for home(), called in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 202 and defined in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 330 Clicked on a user and received the following warnings: Warning: Missing argument 2 for viewUser(), called in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 72 and defined in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 441 Warning: Missing argument 3 for viewUser(), called in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 72 and defined in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 441
-
If you do a search on phpfreaks for "scraping", the results should yield some helpful examples. Tutorials can be found on the web: http://www.merchantos.com/makebeta/php/scraping-links-with-php/#curl_content
-
Looks like you're looping correctly. Are you sure your query is supposed to return more than 1 record?
-
Did you happen to look at the date of this thread? February 06, 2004
-
I'm also failing to understand exactly what you mean. Your thread is titled, "PHP Email", which I don't see how it relates to your question.
-
Sure, why not?
-
What do you mean they're not the kind you've done before? In your original post you mentioned cronjobs. If you have SSH access then setting one up is no problem, otherwise, you are going to have to use the control panel that your host provides you or contact your hosting provider. As thorpe mentioned, so far this has nothing to do with PHP, and I doubt it will. I can move this thread to a more appropriate section for more accurate feedback.
-
Thanks for the reply roopurt, but I have actually already tried that query (sorry I forgot to mention it) which throws the following version error:
-
There are plenty on phpfreaks and especially the web.
-
I tried your query and received the following error. It may be a version issue related to the sub-queries. I can't really spot the correction for the error, any suggestions? mysql> SELECT a.catcode, a.max_meta, b.almost_max_meta -> FROM (SELECT catcode, MAX(meta_id) as max_meta FROM pda_dbs GROUP BY catcode) a -> (SELECT catcode, MAX(meta_id) AS almost_max_meta FROM pda_dbs -> WHERE meta_id NOT IN -> LEFT OUTER JOIN (SELECT max_meta_id -> FROM (SELECT catcode, MAX(meta_id) AS max_meta_id FROM pda_dbs GROUP BY catcode)) -> GROUP BY catcode) b -> ON a.catcode = b.catcode; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(SELECT catcode, MAX(meta_id) AS almost_max_meta FROM pda_dbs WHERE meta_id NOT ' at line 3
-
I am trying to select the two most recent (highest) meta_id's for each distinct catcode. I can only seem to extract one. I am using MySQL 4.1.20. My current query: SELECT meta_id, catcode FROM pda_dbs GROUP BY catcode ORDER BY meta_id DESC; Table structure: mysql> describe pda_dbs; +---------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+---------+------+-----+---------+----------------+ | meta_id | int(11) | | PRI | NULL | auto_increment | | catcode | int(10) | | MUL | 0 | | | version | int(10) | | | 0 | | | oncheck | int(11) | | | 0 | | +---------+---------+------+-----+---------+----------------+ TIA.
-
Can we see the query? How do you even know it's returning the wrong id?
-
Yes. What exactly do you mean by search? If you're talking about extracting specific tags, patterns etc. I can redirect you to the regex section for further help and suggestions. Other than that you're going to have to explain the issue at hand further.
-
The purpose of die after the header call is to ensure that no code afterwards will be executed.
-
[SOLVED] Can anyone spot a mistake here? I can't!
Maq replied to onthespot's topic in PHP Coding Help
That's what I was thinking because usually it throws an error saying that the keys aren't defined constants. But the OP claimed that he echoed the num rows and it displayed... -
Something like this should work (not tested): UPDATE table_name SET level = 2 WHERE topics IN(SELECT topics, COUNT(topics) AS cnt FROM table_name HAVING cnt > 5); Should be the same idea with DELETE.
-
Firstly, this line should be: if (empty($_POST['verify'])) { header('Location:createid.php?verinone=f'); die(); }else Second, it's not just whitespace, it's any output to the browser. So make sure you're not echoing or displaying any HTML whatsoever before any header calls.
-
[SOLVED] Can anyone spot a mistake here? I can't!
Maq replied to onthespot's topic in PHP Coding Help
Associative arrays should have single quotes around the keys. Have you echoed inside your IF statements to ensure they are being reached? Where is '$user_submitted' ever assigned a value? Don't use shortags (), always use <?php.