Jump to content

xwishmasterx

Members
  • Posts

    186
  • Joined

  • Last visited

Posts posted by xwishmasterx

  1. Hello

     

    I am getting some errors when trying to build up a page using include ( Parse error: syntax error, unexpected $end in..)

     

    I know why and where this is happening, but not why it won't work (pretty sure I've done it in the past), anyway more details:

    My page is a simple build

     

    include header.php

    page stuff

    include footer.php

     

     

    The problem is the header checks if the user is logged in and such and ends with:

    if($_SESSION['loggedin'] != TRUE) {
    header("Location: /index.php?=loggedout");
    }else{
    ?>
    

     

    Now the last "else" statement isn't closed which gives the error, but why can't I close it in the footer? like so:

     

    <?php
    }
    ?>
    

     

    Any info would be appreciated ;)

  2. thanks bunch Andy!

    It seems I am in over my head here.lol

     

    my problem is more complicated when I move forward, so the whole scenario comes to this:

    I check for friends (friends_user_id) in one table, then need to grab the friends user_image in another table IF it exists..

    Also, I need to do a "str_replace" for the user image.

     

    I think I'm closing in on getting some freelance work here.lol

     

     

  3. I'm trying to get add some pictures from a database, and wish to use these one at a time on a page.

    Once I have selecting the images with my query (standard select from method), how can I specify these images one at a time? eg:

     

    echo "$picture one"; blah blah echo "$picture two"; on so on?

  4. Hello

     

    I am trying to add a form inside a loop, as I need the same form under each looped table.

    Is there any tricks to make these forms behave seperately, so when a form is processed it doesn't trigger all the forms adding several rows to the database?

  5. Hello

     

    My script is storing images in the database, to make it ready for some smartycode prefix. I wish to just retrieve the value from the database and remove a few characters:

     

    example:

    2012/05/244bebb53c70825476bb9675d49232c8%s.jpeg => remove the%s just before the extension.

     

    Is there a tip to remove like the last 2 characters right before the extension?

  6. Hi

     

    I have some rows where all of them contains a 'te_group' value. I'd like to show all the rows under each group eg:

     

    te_group    id    name

    ------------------------------------

    group1        2    name1

    group1        5    name5

     

    te_group    id    name

    ------------------------------------

    group2        4    name2

    group2        7    name3

     

    can I does this just by using order or group by? The te_group value can be anyhing so I cannot use "WHERE te_group=x"

     

    hope you understand my question :) 

  7. I have been trying for hours to get this to work but, simply cannot get the echo right. Problem is the single ' and double ".

     

    <a href='#' onClick="<?php  for ($i = $start; $i < $end; $i++)
            {
                    // make sure that PHP doesn't try to show results that don't exist
                    if ($i == $total_results) { break; }?>
    window.open('<?php echo ".mysql_result($result, $i, 'te_link')."";?>;<?php }?>">link text</a>

     

    What I am trying to achive is getting my "$results", which are urls to be added like this:

     

    <a href="#" onClick="window.open('http://link1.com'); window.open('http://link2.com'); window.open('http://link3.com');">link text</a>

     

    any help on this one? (PS i know it's a mess )

  8. thanks for posting your info for comparison.

     

    I got fed up with my cheap host who couldn't give me any clues, so just moved to a new host (still shared) and look at the stats now:

     

    Threads_connected = 4
    Threads_created = 70
    Threads_running = 1
    Uptime = 4011023
    Uptime_since_flush_status = 4011023
    

     

    much better ;)

  9. Hello

     

    A quick question. When adding a link to your css file in the header, does the browser read/load that file even if no styles are being used on the current page? Especially, if you have images in your css file, does the browser load them, although they are not actually displayed on the page?

     

    let me know if the question is unclear ;)

  10. It seems I did. I got a much more decent result, however I am not familiar with any of these phrases.

    Can anyone see something that looks wrong. It this point only I have 1 member online on 7 guests on site.

     

    Result:

    Aborted_clients = 187
    Aborted_connects = 15870
    Binlog_cache_disk_use = 0
    Binlog_cache_use = 0
    Bytes_received = 88
    Bytes_sent = 77
    Com_admin_commands = 0
    Com_alter_db = 0
    Com_alter_table = 0
    Com_analyze = 0
    Com_backup_table = 0
    Com_begin = 0
    Com_call_procedure = 0
    Com_change_db = 0
    Com_change_master = 0
    Com_check = 0
    Com_checksum = 0
    Com_commit = 0
    Com_create_db = 0
    Com_create_function = 0
    Com_create_index = 0
    Com_create_table = 0
    Com_create_user = 0
    Com_dealloc_sql = 0
    Com_delete = 0
    Com_delete_multi = 0
    Com_do = 0
    Com_drop_db = 0
    Com_drop_function = 0
    Com_drop_index = 0
    Com_drop_table = 0
    Com_drop_user = 0
    Com_execute_sql = 0
    Com_flush = 0
    Com_grant = 0
    Com_ha_close = 0
    Com_ha_open = 0
    Com_ha_read = 0
    Com_help = 0
    Com_insert = 0
    Com_insert_select = 0
    Com_kill = 0
    Com_load = 0
    Com_load_master_data = 0
    Com_load_master_table = 0
    Com_lock_tables = 0
    Com_optimize = 0
    Com_preload_keys = 0
    Com_prepare_sql = 0
    Com_purge = 0
    Com_purge_before_date = 0
    Com_rename_table = 0
    Com_repair = 0
    Com_replace = 0
    Com_replace_select = 0
    Com_reset = 0
    Com_restore_table = 0
    Com_revoke = 0
    Com_revoke_all = 0
    Com_rollback = 0
    Com_savepoint = 0
    Com_select = 0
    Com_set_option = 0
    Com_show_binlog_events = 0
    Com_show_binlogs = 0
    Com_show_charsets = 0
    Com_show_collations = 0
    Com_show_column_types = 0
    Com_show_create_db = 0
    Com_show_create_table = 0
    Com_show_databases = 0
    Com_show_errors = 0
    Com_show_fields = 0
    Com_show_grants = 0
    Com_show_innodb_status = 0
    Com_show_keys = 0
    Com_show_logs = 0
    Com_show_master_status = 0
    Com_show_ndb_status = 0
    Com_show_new_master = 0
    Com_show_open_tables = 0
    Com_show_privileges = 0
    Com_show_processlist = 0
    Com_show_slave_hosts = 0
    Com_show_slave_status = 0
    Com_show_status = 1
    Com_show_storage_engines = 0
    Com_show_tables = 0
    Com_show_triggers = 0
    Com_show_variables = 0
    Com_show_warnings = 0
    Com_slave_start = 0
    Com_slave_stop = 0
    Com_stmt_close = 0
    Com_stmt_execute = 0
    Com_stmt_fetch = 0
    Com_stmt_prepare = 0
    Com_stmt_reset = 0
    Com_stmt_send_long_data = 0
    Com_truncate = 0
    Com_unlock_tables = 0
    Com_update = 0
    Com_update_multi = 0
    Com_xa_commit = 0
    Com_xa_end = 0
    Com_xa_prepare = 0
    Com_xa_recover = 0
    Com_xa_rollback = 0
    Com_xa_start = 0
    Compression = OFF
    Connections = 121771
    Created_tmp_disk_tables = 0
    Created_tmp_files = 25279
    Created_tmp_tables = 1
    Delayed_errors = 0
    Delayed_insert_threads = 0
    Delayed_writes = 130
    Flush_commands = 1
    Handler_commit = 0
    Handler_delete = 0
    Handler_discover = 0
    Handler_prepare = 0
    Handler_read_first = 0
    Handler_read_key = 0
    Handler_read_next = 0
    Handler_read_prev = 0
    Handler_read_rnd = 0
    Handler_read_rnd_next = 0
    Handler_rollback = 0
    Handler_savepoint = 0
    Handler_savepoint_rollback = 0
    Handler_update = 0
    Handler_write = 132
    Innodb_buffer_pool_pages_data = 508
    Innodb_buffer_pool_pages_dirty = 30
    Innodb_buffer_pool_pages_flushed = 4273
    Innodb_buffer_pool_pages_free = 0
    Innodb_buffer_pool_pages_misc = 4
    Innodb_buffer_pool_pages_total = 512
    Innodb_buffer_pool_read_ahead_rnd = 4310
    Innodb_buffer_pool_read_ahead_seq = 109
    Innodb_buffer_pool_read_requests = 3372955
    Innodb_buffer_pool_reads = 80971
    Innodb_buffer_pool_wait_free = 0
    Innodb_buffer_pool_write_requests = 24089
    Innodb_data_fsyncs = 4134
    Innodb_data_pending_fsyncs = 0
    Innodb_data_pending_reads = 0
    Innodb_data_pending_writes = 0
    Innodb_data_read = 1936281600
    Innodb_data_reads = 90764
    Innodb_data_writes = 6669
    Innodb_data_written = 145515008
    Innodb_dblwr_pages_written = 4273
    Innodb_dblwr_writes = 851
    Innodb_log_waits = 0
    Innodb_log_write_requests = 9921
    Innodb_log_writes = 1868
    Innodb_os_log_fsyncs = 2398
    Innodb_os_log_pending_fsyncs = 0
    Innodb_os_log_pending_writes = 0
    Innodb_os_log_written = 5227520
    Innodb_page_size = 16384
    Innodb_pages_created = 280
    Innodb_pages_read = 118048
    Innodb_pages_written = 4273
    Innodb_row_lock_current_waits = 0
    Innodb_row_lock_time = 14
    Innodb_row_lock_time_avg = 4
    Innodb_row_lock_time_max = 14
    Innodb_row_lock_waits = 3
    Innodb_rows_deleted = 259
    Innodb_rows_inserted = 1464
    Innodb_rows_read = 562494
    Innodb_rows_updated = 1578
    Key_blocks_not_flushed = 0
    Key_blocks_unused = 6258
    Key_blocks_used = 1564
    Key_read_requests = 114892246
    Key_reads = 1886608
    Key_write_requests = 931175
    Key_writes = 134836
    Last_query_cost = 0.000000
    Max_used_connections = 101
    Not_flushed_delayed_rows = 0
    Open_files = 112
    Open_streams = 0
    Open_tables = 64
    Opened_tables = 0
    Prepared_stmt_count = 0
    Qcache_free_blocks = 0
    Qcache_free_memory = 0
    Qcache_hits = 0
    Qcache_inserts = 0
    Qcache_lowmem_prunes = 0
    Qcache_not_cached = 0
    Qcache_queries_in_cache = 0
    Qcache_total_blocks = 0
    Queries = 10138860
    Questions = 1
    Rpl_status = NULL
    Select_full_join = 0
    Select_full_range_join = 0
    Select_range = 0
    Select_range_check = 0
    Select_scan = 1
    Slave_open_temp_tables = 0
    Slave_retried_transactions = 0
    Slave_running = OFF
    Slow_launch_threads = 0
    Slow_queries = 0
    Sort_merge_passes = 0
    Sort_range = 0
    Sort_rows = 0
    Sort_scan = 0
    Table_locks_immediate = 10385198
    Table_locks_waited = 2778
    Tc_log_max_pages_used = 0
    Tc_log_page_size = 0
    Tc_log_page_waits = 0
    Threads_cached = 0
    Threads_connected = 41
    Threads_created = 121750
    Threads_running = 36
    Uptime = 69404

  11. Thanks for the reply. It seems the above does work as I get some results. Do you now how to read this?

     

    Here's the output:

     

    = 140
    = 11075
    = 0
    = 0
    = 88
    = 77
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 1
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = OFF
    = 73294
    = 0
    = 5279
    = 1
    = 0
    = 0
    = 90
    = 1
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 132
    = 511
    = 0
    = 3237
    = 0
    = 1
    = 512
    = 3164
    = 79
    = 2576265
    = 60151
    = 0
    = 12175
    = 3126
    = 0
    = 0
    = 0
    = 1432735744
    = 67332
    = 5055
    = 110339584
    = 3237
    = 675
    = 0
    = 7825
    = 1355
    = 1755
    = 0
    = 0
    = 4065792
    = 16384
    = 85
    = 87314
    = 3237
    = 0
    = 14
    = 4
    = 14
    = 3
    = 248
    = 441
    = 373495
    = 665
    = 0
    = 6470
    = 1412
    = 56677841
    = 1075795
    = 683738
    = 97035
    = 0.000000
    = 101
    = 0
    = 129
    = 0
    = 64
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 5889856
    = 1
    = NULL
    = 0
    = 0
    = 0
    = 0
    = 1
    = 0
    = 0
    = OFF
    = 0
    = 0
    = 0
    = 0
    = 0
    = 0
    = 6157524
    = 1181
    = 0
    = 0
    = 0
    = 0
    = 15
    = 73280
    = 9
    = 45742

     

    Doesn't make much sense^^

  12. Hello

     

    I recently got a "to many connection" error on my site, and want to know if anyone here knows a few codes

    that will show how many connection currently are in use (maybe even what files that creates them).

     

    I found I can use "Threads_connected" to show current open connections, but no info on how to write the code or where to pu the

    file.

     

    I hope you can show my what to do ;)

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