PravinS
Members-
Posts
459 -
Joined
-
Last visited
-
Days Won
2
Everything posted by PravinS
-
How to point last element of an array in PHP?
PravinS replied to Aarav123's topic in PHP Coding Help
Check this: http://php.net/manual/en/function.end.php -
Set headers, 4th parameter of mail() function $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: TO_NAME <TO_MAIL>' . "\r\n"; $headers .= 'From: FROM_NAME <FROM_MAIL>' . "\r\n"; $headers .= 'Cc: CC_MAIL' . "\r\n"; $headers .= 'Bcc: BCC_MAIL' . "\r\n";
-
You can use UPDATE query like this UPDATE table_name SET phone = CONCAT('353',TRIM(LEADING '0' FROM phone)) WHERE SUBSTRING(phone,1,1) = '0'; before that use the SELECT query to check if its correct or not SELECT phone, CONCAT('353',TRIM(LEADING '0' FROM phone)) FROM table_name WHERE SUBSTRING(phone,1,1) = '0'; hope this will find you helpful
-
It will be better if you use ORDER BY DESC and LIMIT 10 in SELECT query, which will give you last 10 records in descending order. Or you can use pagination, by which you can devide records(10 records) per page.
-
You can use OR, your WHERE condition will be like this WHERE MATCH(items.item_title) AGAINST('$search_query' IN BOOLEAN MODE) OR MATCH(type_1.type_1_name) AGAINST('$search_query' IN BOOLEAN MODE) hope this will work for you.
-
Simple php countdown timer starting from sql time
PravinS replied to roger01's topic in Javascript Help
Try AJAX -
file_get_contents() function will return just a page content (view source), it will not execute any javascript or AJAX code, and "Show All" button is providing AJAX based data
-
Full Text search may work for you Refer: http://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html
-
Instead of VARCHAR data type for text use TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT according to your requirement
-
Try this <html> <head> <style type="text/css"> .colleft{ float:left; width:50%; text-align:left } .colright{ float:right; width:50%; text-align:right; } </style> </head> <body> <div> <div class="colleft">Left</div> <div class="colright">Right</div> </div> </body> </html>
-
How to "search" XML and get specific value?
PravinS replied to andyfarang's topic in PHP Coding Help
Try using SimpleXMLElement::xpath http://php.net/manual/en/simplexmlelement.xpath.php -
Also avoid adding <html>, <head>, <title>, <body> tags, just add <body> tag content in mail body
-
where ever you communicate with database, connection code should be added
-
you have not included "dbconfig.php" database connection file in "registration.php" file also use error_reporting(E_ALL & ~E_NOTICE); at the top, to check PHP errors
-
also you have not given name to submit button
-
In index.php file you have form tag without method, so by default form method is GET just replace below line <form action="mysuperscript.php" autocomplete="on"> with <form action="mysuperscript.php" autocomplete="on" method="post"> i hope this will work for you
-
I think you have used Form GET method instead of POST
-
Try using this function function sort_array($array, $sortkey, $order) { if ($order == "DESC") $or = "arsort"; else $or = "asort"; foreach ($array as $key => $array_row) { $sort_values[$key] = $array_row[$sortkey]; } $or($sort_values); reset($sort_values); while (list ($arr_key, $arr_val) = each($sort_values)) { $sorted_arr[] = $array[$arr_key]; } return $sorted_arr; } hope this will work for you
-
use quotes around option value or use select box as <select name="charity_name" id="charity_name"> <?php while ($row=mysql_fetch_array($charity)) { echo '<option value="'.$row[charity_name].'">'.$row[charity_name].'</option>'; } ?> </select> hope this will help you
-
oh sorry, i missed that
-
You missed mysql_query() for UPDATE query, also SELECT query should be below UPDATE query, so you will get updated data <?php require("bd/conexao.php"); if ($row{"visivel"}== 0) { $update= "UPDATE produtos SET visivel = 1 WHERE visivel = 0"; mysql_query($update); echo $update; } else { echo "o produto ja esta visivel"; } $sql = "SELECT * FROM produtos"; $resultado = mysql_query($sql); $row = mysql_fetch_array($resultado); ?>
-
Try this query SELECT username, count(username) AS post_count FROM TABLE_NAME GROUP BY username ORDER BY count(username) DESC; you can apply LIMIT to get top records, as query will give sorted result according to max post count of user.
-
you need to use $result = mysqli_query($link, $query); before $result_array = mysqli_fetch_array($result); or check this URL: http://php.net/manual/en/mysqli-result.fetch-array.php
-
have you restarted the XAMPP after updating the php.ini file? if yes, then it should work