Jump to content

cujo

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cujo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. XXAMP? I guess it's one of those all in one packages like WAMP. Everything is set up for you, it couldn't be easier. Make sure all services are started by clicking (or right clicking) the tray icon, and enter "localhost/phpmyadmin" into your browser address bar (I think you mean phpmyadmin, not WinMySQLAdmin).
  2. Does creating a separate database with all the tables seem like a good solution?
  3. A number of years ago, around 2002 I believe, when I first got into PHP and I had my first webserver, there was a "crontab" file that could be modified and set to execute scripts at pre-determined intervals. I'm not sure if 'crontab' is obsolete now, you might want to do a google search. Alternatively, you can add a 'timestamp' column to your table, and place the code below in a script that you know a user will execute - preferably in the page where you are inserting the values into the table. By the way, the number 259200 is the number of seconds in 3 days. "time" is the name I happened to choose for the timestamp column. $timestamp = date(U); $prevtime = $timestamp - 259200; mysql_query("INSERT INTO table values ('$var1,'$var2',$timestamp)"); mysql_query("DELETE FROM table WHERE time < '$prevtime'");
  4. Hi, I'm looking for a way to organize some data. There will be a fairly large number of data tables to be inserted into the database. Unfortunately, the number of rows and columns for these data tables will not be constant. I want to assign a unique id to each cell and store the data for that cell (maybe two separate tables for the id and the data?). I want to know if it's possible to insert tables of this sort into a MySQL table. The only thing I can think of is creating a very large table (the max amount of rows and columns I could expect). However I imagine this would be messy and inefficient. Or is it possible to create a new table in the db for each data table? This would be messy but more efficient. Is there a better way of doing this? Thanks in advance
  5. It's always something glaringly obvious, isn't it? Thanks for your help, Wildbug, I figured out what I was doing wrong.
  6. It doesn't work. Bold works, but subscript and superscript does not. I can't get center to work either.
  7. I would also like to know how to do it for
  8. I have an issue with replacing BBCode with html. I found a script that does all the conversions for me, but one thing it leaves out is superscripts and subscripts. I thought I'd simply modify the bold code: $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<span class="bold">$1</span>',$Text); With the superscript and subscript code: $Text = preg_replace("(\[sub\](.+?)\[\/sub])is",'<sub>$1</sub>',$Text); $Text = preg_replace("(\[sup\](.+?)\[\/sup])is",'<sup>$1</sup>',$Text); But that didn't work. I found some articles on regex, but they were pretty vague. I was hoping someone could help me out.
  9. Try this: [code] print substr($thestring, 0, $numchars) . "..." [/code] Where numchars is the number of characters you want to limit the string to.
  10. That didn't work. The values in the table are literally printed as Array[1][1], Array[1][2].
  11. I have a foreach loop that enters the values of an 3-dimensional array into a table. It's something like this: [code] foreach($thearray[$val1][$val2] as $value){    mysql_query("INSERT INTO table VALUES ($value, etc, etc)"); } [/code] When I look at the table, the first few values are Array[1][1], Array[1][2], etc. followed by the correct values. Does anyone know how to fix this?
  12. [!--quoteo(post=369941:date=Apr 29 2006, 03:23 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Apr 29 2006, 03:23 PM) [snapback]369941[/snapback][/div][div class=\'quotemain\'][!--quotec--] [a href=\"http://ca.php.net/manual/en/function.mysql-insert-id.php\" target=\"_blank\"]php.net/manual/mysql-insert-id[/a] - does that help? [/quote] Awesome, thanks a lot man.
  13. Hi, I'm new to these forums and I'd appreciate it if you could help with a problem I'm having. I have a table where there is an auto_increment value that serves as the ID for each entry into the table. In my script I insert a new entry into the table, and I need the value of the ID for the entry that was just inserted. Right now this is what I'm doing: $id_query = mysql_query("SELECT id FROM table ORDER BY id DESC LIMIT 1"); $id = mysql_result($id_query,0); That should get the ID for most recent entry from the table, right? There's one problem. Multiple entries are inserted into the table during the execution of the script, and I'm worrying that if more than one person is using the script at the same time that the values might get mixed up. Can anyone shed some light onto this problem?
×
×
  • 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.