Jump to content

aebstract

Members
  • Posts

    1,105
  • Joined

  • Last visited

Posts posted by aebstract

  1. Okay, I'm sort of stuck on actually displaying the information.

    <?php
    
    $server = '1';
    
    $link = mssql_connect($server, '2', '3');
    
    if (!$link) {
        die('Something went wrong while connecting to MSSQL');
    }
    
    $query = mssql_query("SELECT * FROM information_schema.tables");
    while($r=mssql_fetch_array($query))
    {
    
    echo mssql_result($query);
    
    }
    
    
    
    
    ?>
    

     

    Blank page, I'm assuming I'm connected as I get no error and this is the method that was used as demonstration in the php manual. So that brings me to actually displaying the information, which I usually would do a while and loop through each row of information in a table, though this is obviously different and I'm not looping through like that. How can I echo out the information so I can see it?

  2. I've never worked in microsoft sql, so I am not sure if it is in any way similar to mysql or completely different. I'm also somewhat limited on support and what I have access to. I can run php and have full ftp access. I can probably run .net as well, as the site is running on dotnetnuke and from what I've read that is based off of .net. I have no idea whatsoever how to even look at .net, so I would prefer staying with php.

     

    Is there a way to use the sql server info and view all database information? I hope it is structured somewhat similar to mysql, as in having tables, columns/rows, etc. I don't know what tables I have, don't know anything really. I'm going to have to start working on a huge port out and port in to a new system (which will be mysql) and this is my first step. Any advice/info/tips is awesome. Thanks!

  3. A more 'ghetto' way to do this, which I think will work in my situation, will be to grab all results where that column contains 'TYSON' regardless of position and regardless of first 5 characters. I think that would be easier to grab and I may be able to find a solution.

  4. I assume you can write PHP code that hits the database.  If that's the case you can query the information_schema for the tables and columns in this database and therefore don't need a management software.

     

    If I were in your shoes I'd create a PHP script that dumps the database to text files in a lossless fashion.  Then I'd go about writing the code to import these text files into your target database.

     

    I'll tell you now though, database migration is a huge pain in the ass.

     

    Thanks for the information, I can forsee it being a huge pain in the ass. It may be my only option though, which if so.. will definitely suck. Thanks again for the information you were able to provide ;)

  5. I need to limit the results I am grabbing from my query, I need to check if the first 5 characters of the column are equal to 'TYSON'. I know how to do this if it's not "first 5 characters" of the column, anyone shed some light on this? Thanks

  6. They have the single worse support I have seen in my entire life. I got hung up on several times, called an idiot and told that if I called to "harass" the support team anymore that the account was going to be canceled. I plan on having the owner switch hosting companies, it's just that I need to get this information extracted out so that I can do the transfer to phpbb somehow, probably through some queries I will have to write up.

     

    Once I get connected in and can see/manage/use my database information, what will I need to do to actually transfer it to a mysql database? Is that possible?

  7. Not sure if this is the right area or if there is even a right area on phpfreaks, but there are lots of smart people here and someone may have the answer I am looking for. I am having to do some stuff on the database for a dotnetnuke setup, it's all on a windows based web host (will be switching to linux and normal mysql). I've never done anything with sql server 05 and the host has no application to actually go in and manage the database (such as phpmyadmin for mysql). What can I do? I'm really at a loss here as I have no idea where to start, is there something I can do to access it from outside of the control panel? Basically wanting to transfer all users/posts/etc from the dotnetnuke over to a phpbb system.

    Thanks

  8. Well you added an = sign between the two. What doesn't work about it? You should add 

    or DIE(mysql_error());

    on to the end so that you can find any errors you have.

     

    Not to mention you apparently have <?php twice, back to back?

  9. $query = mysql_query("SELECT * FROM calendar WHERE MONTH(caldate) = '$calmonth2' && YEAR(caldate) = '$calyear' ORDER BY DAY(caldate) LIMIT 1") or DIE(mysql_error());
    

     

    I have 4 rows, they have a field called event_tag. I want to grab 1 result from each unique event_tag. My query is obviously wrong, but I'm hoping I'm close and not much needs to be changed. Thanks

  10. Can I have an array like this?

     

    Array ( [12] => Array ( [id] => 1 [date_start] => 2010-02-12 [date_end] => 2010-02-14 [description] => [flyer] => test.jpg )
               [13] => Array ( [id] => 1 [date_start] => 2010-02-12 [date_end] => 2010-02-14 [description] => [flyer] => test.jpg )
               [14] => Array ( [id] => 1 [date_start] => 2010-02-12 [date_end] => 2010-02-14 [description] => [flyer] => test.jpg )
               [12] => Array ( [id] => 3 [date_start] => 2010-02-12 [date_end] => 2010-02-12 [description] => [flyer] => jump.jpg ) ) 
    

     

    I'm trying to figure out a good way to do events with a calendar, if I can have an array like this it'll help a lot. Not sure if the key numbers can be the same or not? See the 12 and 12?

  11. $query = mysql_query("SELECT * FROM calendar WHERE date('n', date-start) = '$calmonth2'") or DIE(mysql_error());

     

    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 ' date-start) = '2'' at line 1

     

    Can I use date like this in a query? Seems like I would get a different error if I couldn't.

  12. if you have a recent version of MySQL, you can do this right in the query:

     

    SELECT * FROM table ORDER BY SUBSTRING_INDEX(post_subject, ' ', -1) ASC

     

    give that a shot.

     

    I figured there was something, was looking around. Neat stuff. If this won't work for you, you COULD run 2 queries, do your first one grabbing unique ids and names, explode them and then run another to get your information and order by surname where id = id# or something along those lines.

×
×
  • 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.