Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by bubblegum.anarchy

  1. Hi premiso, Then shouldn't the string content in quotes appear in the HTML source as a tag? I actually do not want the username and password to appear in the source or be displayed in the browser so the code does what is required, i'm just trying to understand why for security reasons... <?php //username:password ?> makes more sense but does not work on the remote server (but works locally for some strange reason) in the particular API (AS3's URLRequest and URLLoader classes) used. premiso, would you agree that the username and password values are inaccessible and secure? Thank you for responding.
  2. Hi There, Why does the following PHP code display nothing in a browser? <?php print "<?php //username:password ?>"; ?>
  3. What is the value of $j ? - maybe use sizeof($snowdata) instead, depending on application. Consider something like this, for the fun factor: for ($i = 0; $i < sizeof($snowdata); $i++) { $query = "INSERT INTO weather VALUES ("; for ($n = 1; $n <= 14; $n++) $query .= "'{$snowdata[$i][$n]}',"; $db->query($query = substr($query, 0, strlen($query) - 1).")"); }
  4. Try: AND orders.OrderID IN (9,10,11)
  5. http://www.phpfreaks.com/forums/index.php/topic,125759.0.html
  6. I would like to know how since afaik an update can not be made based on a subset of the same table.
  7. $_POST[$value1] = isset($_POST[$value1]) && is_numeric($_POST[$value1]) ? "'".$_POST[$value1]."'" : "NULL"; $_POST[$value1] = isset($_POST[$value1]) && is_numeric($_POST[$value1]) ? "'".$_POST[$value1]."'" : "NULL"; settype($_POST[$id], "integer"); query = " UPDATE table SET column1 = {$_POST[$value1]}, column2 = {$_POST[$value2]} WHERE id = {$_POST[$id]}";
  8. Probably something like this: SELECT * FROM tablename WHERE ( hello = '1' OR hello2 = '1' ) AND id >= FLOOR( RAND( ) * ( SELECT MAX( id ) FROM tablename ) ) ORDER BY id ASC LIMIT 1
  9. This is what I do: SELECT * FROM repository ORDER BY sort_column IS NULL, sort_column
  10. Step through the max three rows returned from the following: SELECT tipType, group_concat(concat_ws('<BR />', concat('Tip Number: ', tip_num), concat('Tip Title: ', tip_title), concat('<IMG src="', tip_pic_top, '" />')) SEPARATOR '<BR />') AS tip_info FROM tipsntricks WHERE tipType IN ('exhaust', 'suspension', 'engine') Update the column names.
  11. Does the following produce the same results faster? SELECT sum(inquiries.iduser IS NOT NULL) AS icount, sum(response.iduser IS NOT NULL) AS rcount, ifnull(sum(ratings.total_value) / sum(ratings.total_votes), 0) AS avgscore FROM users LEFT JOIN inquires ON users.id = inquries.iduser LEFT JOIN responses ON users.id = responses.iduser LEFT JOIN ratings ON responses.idresponse = ratings.id WHERE users.id = '{$id}' Speed is probably more important when dealing with the dynamics of the Internet. Storage size is less dynamic and easier to control than bandwidth traffic.
  12. Also consider switching: if (array_key_exists('userid',$_SESSION)) { to: if (isset($_SESSION['userid'])) {
  13. A primary key identifies a record and indexing increases search times; primary keys are indexed.
  14. Pretty much just switch the double and single quotes. settype($isOn, "integer"); mysql_query($query = " REPLACE INTO info_comments (Id, Text, isOn) VALUES (1, '".mysql_escape_string($aboutus)."', {$isOn})") or trigger_error(mysql_error()."<PRE>".$query."</PRE>", E_USER_ERROR);
  15. If there is only every going to be one comment per user than add a field to the profile table named comment otherwise create a separate table something like: comment.user_id comment.date_created comment.comment
  16. Define a column based on the outlined conditions and sort accordingly. The column definition could include an IF ( order_details.date > CURRENT_DATE - INTERVAL 90 DAY, count(productid), 0 ) so that the value is 0 if the date is older than 90 days.
  17. Grab both job and company information with a join, also use group_concat if you want a single job record with a column that contains all the associated company records instead of duplicate rows of job records along side respective company record.
  18. An INT A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295. Try a BIGINT instead A large integer. The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615.
  19. $srippicid = stripslashes(strip_tags($_POST['picid'])); //not workig $escapepicid = mysql_real_escape_string($strippicid); //not working $srippicid is missing a t
  20. Try applying the mysql_real_escape_string() function to $newtext before the query string instantiation.
  21. Consider this: $query = sprintf(" INSERT INTO {$table_name} (name, address1, address2, address3, address4, postcode, fitting) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s')" , mysql_real_escape_string($_POST['name']) , mysql_real_escape_string($_POST['address1']) , mysql_real_escape_string($_POST['address2']) , mysql_real_escape_string($_POST['address3']) , mysql_real_escape_string($_POST['address4']) , mysql_real_escape_string($_POST['postcode']) , mysql_real_escape_string($_POST['fitting']));
  22. SELECT * FROM pictures a , attributes b , pic2att c WHERE a.id = c.picid AND c.addi = b.id AND ( b.id = 10 OR b.id = 12 )
  • 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.