Jump to content

phpology

Members
  • Posts

    15
  • Joined

  • Last visited

About phpology

  • Birthday 04/21/1981

Contact Methods

  • Website URL
    http://www.phpology.co.uk

Profile Information

  • Gender
    Male
  • Location
    London

phpology's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. check out this example when I searched google "set names mysql" http://forums.mysql.com/read.php?103,244307,244307
  2. remove the ?> from this line: echo</form>";?>
  3. after you have opened your connection to your database, run this query also if you are not doing it already: mysql_query("SET NAMES 'utf8'"); //should only call once during life of connection. Also assuming you got the meta tag in placed to: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. You would need to go through your recordset and write the links yourself when you are looping: while($result = mysql_fetch_array($recordset)) { echo "<a href=\"cities.php?country_id=".$result['id']."\">".$result['country_name']."</a>\n"; } when cities.php is opened you then run another query to get the list of cities based on that country id. You could do it all inline i.e. without jumping to another php page using jquery/ajax but that is your call. or what you can do is create a 3d array where you combine all your results in one array but I am guessing there is going to be loads of data so this method might not be that useful.
  5. Something random but check your /tmp folder maybe to see if you can write to it. Had a problem like that quite some time ago which had me confused. Or debug your $_SESSION with print_r($_SESSION)
  6. while($row = mysql_fetch_array($result)) { $data_array[] = $row; } //now what you can do is use that $data_array where you want in that page if(count($data_array) > 0) { foreach($data_array as $data) { echo $data['col_name1']; echo $data['col_name2']; //etc, etc } }
  7. if you can run php via command line then you should be able to use that in the Run textfield in the Scheduler like below: php full_path_to_php_script
  8. I agree with Pikachu2000 with the timestamp of creation but are you also not planning to have a general date of the article too? a d/m/Y format which the user controls and the news is ordered by that. Generally, you should show 5/10 items and have view archive or something which shows all. Or add in a trigger field to mark it as archived. But probably making it "complicated" as that is a manual process after.
  9. try using a hashtag i.e. <a name="r-u-sure"></a> and place that clsoe to your confirmation area When you repload your page add in #r-u-sure at the end of your url like this: repload.php#r-u-sure. Why dont you use javascript confirm() to ask for confirmation when deleting?
  10. Dont see it being an issue to be honest but you should think about adding an error tracker maybe, in case it fails or your script breaks with malformed email addresses (make sure its a valid format when they save an event). Actually increase your script time out in case you are sending out loads of emails during that time frame. set_time_limit() something to think about - make sure you index your datetime column too so you get faster data retrieval
  11. in your select list example you have added an attribute called value which does not work with select lists as its assigned to the option. if you want your option to be selected based on your db value you need to do an if-else within each option something along the lines of this <option value="Fall 2010" <?php if($ship_season == "Fall 2010") {echo " selected"; }?>>Fall 2010</option> <option value="Spring 2010"<?php if($ship_season == "Spring 2010") {echo " selected"; }?>>Spring 2010</option> <option value="Fall 2011"<?php if($ship_season == "Fall 2011") {echo " selected"; }?>>Fall 2011</option> <option value="Spring 2011"<?php if($ship_season == "Spring 2011") {echo " selected"; }?>>Spring 2011</option> if you were generating your selectlist options via a db then it would be a lot cleaner to be honest as then you dont have to hardcode each option like the above. hope this helps
  12. for your first question, you can concatenate your $general variable i.e. $gallery = "lorem"; if($next_word == "ipsum") { $gallery .= " ipsum<br />"; $gallery .= "<a href=\"http://www.domain.com\">lorem ipsum</a>" } echo $gallery; fopr your second question, rather then run 2 queries why dont you run something like this select * from users order by rand() limit 1
  13. or you could use $_REQUEST which will give you values if you have subbmited via a form or by getting params from a URL.
  14. Or pass them across with $_SESSION[]. Just remember to start it be for hand
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.