Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
You need to pass it to the page where you're performing the query. You can use multiple methods, GET, POST, sessions, etc... it all depends on what/how you want to pass it. Please post some pertinent code from david_weintraub.php where '$week_1' gets its value. That's exactly my point. '$week_1' does not have a value, so you're comparing week to nothing which doesn't return anything.
-
mysql_insert_id takes a resource id, not a database connection.
-
You're using '$week_1' in your query, where do you assign it a value? echo $p_1_f;
-
Where is $week_1 initialized? You can echo out the query to see exactly what's being queried.
-
So, in your table each record is assigned a classified type, and you want to call a certain page based on that type? Can you post your table structure and the different types? You can probably just query the database based on the record they click and see what the classified type is, then pass the type via http to determine what page should be called.
-
Can you post the pertinent code?
-
It's all in the manual, just find out what charset you need and specify it the headers - mail.
-
Parse error: syntax error, unexpected $end in /home/xxxxx/public_html/shop/admin
Maq replied to isiah's topic in Applications
Not many people are going to download your code. Please post the relevant code, lines surrounding 1060. (probably a missing '}' before 1060, like Ken mentioned) -
You don't create cron jobs with PHP... There should be a crontab already on the server that you can add your PHP script to. What are you doing that needs to be performed every 10 seconds? There may be a better way.
-
[SOLVED] mysql_query returns 0 rows but query works in mysql
Maq replied to bluedragon's topic in PHP Coding Help
That's weird... -
This just gets "name", and takes the comma out as well. If you want to take the comma out yourself then remove ',?'. $names = "2-Name,3-Name,4-Name,5-Name,6-Name,7-name"; $array_name = preg_split("/,?\d-/",$names); print_r($array_name); ?>
-
It's using a ternary operator. The equivalent in an if/else is: if(strlen(decbin(ord($txt_str[$i]))) { $bin .= str_pad(decbin(ord($txt_str[$i])), 8, 0, str_pad_left); } else { $bin .= decbin(ord($txt_str[$i])); } Can't really help you unless you provide some more information.
-
Change this line: while ($row_c = mysql_fetch_row($result_c)) to this: while ($row_c = mysql_fetch_assoc($result_c))
-
All the errors that you posted are just notices/warnings and will not cause a blank page. Blank pages are usually caused by, like I've said before, fatal syntax errors. Are there any actually errors? No that wouldn't cause a blank page. It's hard to tell without looking at your code. Can you post your entire code?
-
Why don't you use: WHERE cities.name = city_buildings.cityname I don't think IN should be used like that, but I could be mistaken.
-
I agree, but it's good to have them on for when developing on development environment. The notices won't cause fatal errors but could potentially cause other problems like you're seeing in your situation. In a live environment you don't want these turned on. The code I provided does effectively the same thing as fanfavorites, but mine will give you a default value, and is only 1 line
-
The more the merrier!
-
- Have a field in your database for storing the last time they performed this action. - Every time they perform this action you need to do a check to see if the difference between the last time they committed this action and the current time, was > 24 hours. - If it is > 24 hours, let them perform the task and update the field with the current time. - If not, display your error message, and leave the time that was in the field.
-
Before the select menu put this line in: $_SESSION['lang'] = (isset($_SESSION['lang'])) ? $_SERVER['lang'] : "English"; This will assign $_SESSION['lang'] to English if it is not set, if it is then it will stay the same. The error you were seeing was due to that session variable not being set, if you want the default selected language to be something else, then just change English to whatever you want.
-
It's not that, it's the fact that you post something and ask if it will work. Instead you should try it out and tell us what the errors are, what happens, what's supposed to happen, etc... Ooo, Chimay for me.
-
Is it necessary to have the comments separated by pipe lines (|)? Like Masna suggested, if you're dealing with XML, you should do it properly. My suggestion would be something along the lines of: $sql = "SELECT id,title,body from news"; $result = mysql_query($sql) or die ("Couldn't execute query: Reason; ".mysql_error()); while($row = mysql_fetch_assoc($result)) { $xml .= ""; $xml .= "{$row['title']}"; //get the comments $query_c = "SELECT id,body FROM comments WHERE news_id={$row['id']}"; $result_c = mysql_query($query_c) or die('Error : ' . mysql_error()); $xml .= ""; while ($row_c = mysql_fetch_row($result_c)) { $xml .= "{$row_c['body']}"; } $xml .= ""; }//end main while ?> What are you checking the XML with? You can use XPath to see if there are no comments by checking the child of .
-
Possibly, have you tried it? What? It wasn't working because you had too many characters? ^7777777 supposed to be ^777777 > Gotcha, that's what I thought, your wording threw me off.
-
[SOLVED] using file_get_contents() with real websites
Maq replied to contra10's topic in PHP Coding Help
Those are usually the hardest ones to find -
What? It wasn't working because you had too many characters?
-
No problem. So you have resolved the issue, and everything is working properly now?