Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. What about if the title is not based on the English alphabet? <?php //$row['title'] = 'jazz'; $row['title'] = 'джаз'; $currLetter = substr($row['title'], 0, 1); echo $currLetter You might be considered using multibyte string functions in php. You do nothing to prevent your code of sql injections. Read this article up - https://www.owasp.org/index.php/SQL_Injection
  2. I missed that one Before to concat (".") a string it's a good practice to define that variable to empty string otherwise you will get a notice of undefined variable! $queryResult = ''; while($row = $result->fetch_assoc()){ $queryResult .= " <tr> <td>$row[Scott]</td> <td>$row[Den]</td> <td>$row[Color]</td> <td>$row[Cond]</td> etc ........ </tr> "; } echo $queryResult;
  3. I spoke with my friend few days ago he is a sysadmin using windows systems and he told me to use the parental control provided in windows 8.
  4. Use the next pattern when indexes of the array consists a string: <td>$row[70J]</td> to <td>{$row['70J']}</td> Why did you close the statement before fetching all rows from db server? Where do you get this message in the firebird (js tool) console?
  5. A sample of your code would help us. Are you using AJAX in that project?
  6. No, I did not say that! I was my fault. I've just forgot that the sql parser (in most db servers just for query performance) start reading a query first from where condition before to go further on. So, the parser like in the example above doesn't even know that this is a select statement. I will try later on, when I get home. Are you thinking that I'm here wasting my time arguing with you or somebody else?
  7. What me or you or somebody else think, it doesn't really matter. For the sql parser, this is a syntactically invalid query returning a fatal error. @iarp, I don't think that you are able to execute global variables directly to the db server using a prepared method like in your example.
  8. @Jacques1, the select statement is invalid not because of lack of FROM clause in the string (it's optional) but because of WHERE one @iarp, it's time to start to think like a programmer. You need to learn more about debugging process. Just google it
  9. You wanna pay $29.00 for virus Do you know what a keylogger is? I am with ManiacDan here to flash your home router with dd-wrt. Here's a list of all supportive routers - ftp://ftp.dd-wrt.com/others/eko/
  10. I've never heard someone to concat (".") operators like in the example, strings...especially long ...YES, but never operators
  11. Because a phrase that is enclosed within double quote (“"”) characters matches only rows that contain the phrase literally, as it was typed. They are not the quotation marks that enclose the search string itself - http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html Can you provide same sample of data and tell us what result you are expecting to get.
  12. works for me: $q = 'South shields'; $string = '"' .$q. '"'; echo $sql = "SELECT COUNT( City ) AS Hotel, City, CountryName, Country FROM `activepropertylist` WHERE MATCH(city,Countryname) AGAINST ('+$string' IN BOOLEAN MODE) GROUP BY City,Countryname,Country ORDER BY City"; Result:
  13. Try, <?php ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); include('../connect.php'); $id = $_SESSION['SESS_MEMBER_ID']; $result = mysql_query("SELECT * FROM student WHERE id='$id'") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo '<tr class="record">'; echo '<td style="border-left: 1px solid #C1DAD7"><div align="left">' . $row['date'] . '</div></td>'; echo '<td><div align="left">' . $row['amount'] . '</div></td>'; echo '</tr>'; } ?> Why the columns idnumber, date and amount are varchar's type? Where do you start a session in your application?
  14. Yes, b/s every number is less than every capital and lower letters - http://www.asciitable.com/ function myfunction($a,$b) { if ($a===$b) { return 0; } return ($a > $b) ? 1 : -1; } $a = 'a'; $b = 'B'; var_dump(myfunction($a, $b)); // int(1) Capital "B" is less than lower 'a'. Hm.......NO....I am wrong <?php function myfunction($a,$b) { if ($a===$b) { return 0; } return ($a > $b) ? 1 : -1; } $a = 1; $b = 'a'; var_dump(myfunction($a, $b)); // int(1) But not in javascript: function MyFunction(a,b) { if(a === b) return 'equal values'; return (a < b) ? 'a1 is less than a2' : 'a1 is greater than a2'; } var a1 = 'a'; var a2 = 1; alert(MyFunction(a1,a2)) I made the first test in JS Sorry for that.
  15. Barand is already gave you a solution here. Gizmola is wrong b/s your structure is the same as Jacques1 stated above.
  16. You need to be more specific on what exatly do you mean? According the OP's question I do think, that he wants to run multiple statements (queries) in one query string, so MySQL server allows to do this. About security...that's a different story.
  17. I was thinking that the query method works similar like an exec() one, however, thanks for that and I don't also say that my script is bad and broken regarding OP wishes @Maze, stay there and enjoy your coffee. We are all freaks here
  18. @Jaques1, how could I know that he uses a MySQLi driver? Why and most important how can I use a prepared statement in the script above b/s I don't see what values need to be prepared from db server
  19. Have you read my reply above? Example in php using a pdo driver: <?php $username = 'user'; $password = 'pass'; $dbh = new PDO('mysql:dbname=db_name;host=db_address;charset=utf8', $username, $password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql= "CREATE TABLE `pois` ( `id` bigint(20) unsigned NOT NULL, `lat` float(10,7) NOT NULL, `lon` float(10,7) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `pois_tag` ( `poisid` int(11) NOT NULL DEFAULT '0', `tagname` varchar(45) NOT NULL DEFAULT '', `tagvalue` varchar(255) DEFAULT NULL, PRIMARY KEY (`poisid`,`tagname`) )"; $query = $dbh->query($sql); unset($dbh);
  20. Try to add a semicolon (";") at the end of any sql statement telling a parser where the end of that statement is. CREATE TABLE `pois` ( `id` bigint(20) unsigned NOT NULL, `lat` float(10,7) NOT NULL, `lon` float(10,7) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `pois_tag` ( `poisid` int(11) NOT NULL DEFAULT '0', `tagname` varchar(45) NOT NULL DEFAULT '', `tagvalue` varchar(255) DEFAULT NULL, PRIMARY KEY (`poisid`,`tagname`) )
  21. text only....the app should have a simple graphical user interface.
  22. Interesting...what happens if you try to log into a console as apache or OHS user trying to call this php script directly from terminal? Use a checkconfig command to activate the service booting it to whatever runlevel(s) you want to be. PS: I will try to install this service onto my redhat server later on.
  23. If you are using a local server the easiest way is to mount the partiotion where your crashed OS and DB server were depolyed using an external live cd with linux copy and copy db binary files to the new drive or use a rescue cd. What's the name of crashed OS? Windows?
  24. This works for me: <?php session_start(); if(!isset($_SESSION['product1'])) $_SESSION['product1'] = 0; $addItem = 1; $_SESSION["product$addItem"] = $_SESSION["product$addItem"] + 1; echo "product$addItem = ".$_SESSION["product$addItem" Check $addItem and what value do you get. Your example is an example of bad codding design.
  25. I don't know....may be you're resetting every time this session variable value to 0 (zero)
×
×
  • 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.