619 Posted Topics
![]() | Re: Your loop is messy. This code shows simple looping for showing data in tabular form. [CODE] <?php $username="root"; $password=""; $database=""; mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM jokes"; $result=mysql_query($query); echo '<table width="900%" border="0">'; while($sar = mysql_fetch_assoc($result)) { echo '<tr> <td>'.$sar['name'].'</td> <td>'.$sar['content'].'</td> </tr>'; } echo '</table>'; mysql_close(); … |
Re: Can you replace your code with this. Also make sure image exists in given path. [CODE] var new_icon = new GIcon(); new_icon.image = "images/car_blue.png" ; new_icon.size = new GSize(16,16) ; new_icon.iconAnchor = new GPoint(6, 20); new_icon.infoWindowAnchor = new GPoint(5,1) ; var marker = new GMarker(point, new_icon); map.addOverlay(marker); [/CODE] | |
Re: You can make changes according to your database. [CODE] <? mysql_connect('localhost','root',''); mysql_select_db('test'); $sql = "select student_name,student_sirname from student"; // Query Database $filename = 'file.csv'; $rsSearchResults = mysql_query($sql) or die(mysql_error()); $out = ''; // fiels to export $out .='Student Name,Sirname'; $out .="\n"; // Add all values in the table while ($l … | |
Re: Your question is pretty unclear. Do you have problem with matching posted id with table OR dou you want to parse html ? | |
Hi Friends, I am having one contact-us php script. Here i have used php mail function to send email to admin. Even-though i have also used captcha coding, admin is still continuously getting spam (dummy texts) contact us emails. Actually I am not sure how spammers do such activity. If … | |
Re: You can not get it in [B][U]urgency[/U][/B]. First you have to refer 2 or 3 matching sites like naukri, monster. Then you can discuss with your client and decide your required modules. You can simultaneously design database and can start working on admin panel. | |
Re: Here is a code for date difference you can use $days and save it in your database. [CODE] <? $duedate = '2011-04-29'; $currdate = date('Y-m-d'); $date1 = $duedate; $date2 = $currdate; $diff = abs(strtotime($date2) - strtotime($date1)); $years = floor($diff / (365*60*60*24)); $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); … | |
Re: ics file is sort of xml structure. You can find xml php parser or xmltoarray function [URL="http://mysrc.blogspot.com/2007/02/php-xml-to-array-and-backwards.html"] like this[/URL] and then can save its value in mysql database. | |
Re: If iframe's search page is your php code then you can make a session and save last url in that session. When page is loaded or refreshed you can use session's remembered url as a src of iframe. | |
Re: 1) Why there is two time mysql_connect 2) what is $data['taxrate'], it is nevwe defined above code. [CODE] $taxrate = $_POST['taxrate']; echo "taxrate " . $data['taxrate']; [/CODE] 3)there should be some variable which hold mysql_fetch_assoc result. [CODE] mysql_fetch_assoc(mysql_query($query)); [/CODE] 4) so finaly [CODE] <?php mysql_connect("localhost", "root", ""); mysql_select_db(numbersdb) or die("Unable … | |
Re: You can use mysql_real_escape_string function for filtration. Refer this link.[URL="http://in2.php.net/manual/en/function.mysql-real-escape-string.php"]http://in2.php.net/manual/en/function.mysql-real-escape-string.php[/URL] | |
Re: This is because default timezone for mysql and php is different. Check [URL="http://forums.mysql.com/read.php?10,259199,259245#msg-259245"]here[/URL] for mysql timezone and [URL="http://php.net/manual/en/function.date-default-timezone-set.php"]here[/URL] for php timezone. | |
Re: I think you need ajax.Reason is below. let you have a result in frame-1. Once you submit form page is refreshed. So even your next target is frame2, your frame1 data will be cleared because of second form submit. | |
Re: ckeditor is one of the mostly used editor. [URL="http://ckeditor.com/demo"]check here demo[/URL] And see fourth tab (Custom toolbar) All editor icons are customized, you can change configuration based on requirement. | |
Re: Previously i have explained you reason for foreach error. Also as i said your given API string is not working for me. Here is API link i found for yahoo. [URL="http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=yahoo"]http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=yahoo[/URL] You can find more parameter options here. [URL="http://developer.yahoo.com/search/web/V1/webSearch.html"]http://developer.yahoo.com/search/web/V1/webSearch.html[/URL] | |
Re: For php error, Always put foreach in if condition. [CODE] if(count($rs['items'])>0) { foreach($rs['items'] as $item) { //--- code--- } } else { echo 'There is no items...'; } [/CODE] And for URL there are some php variables in url like [B]$search[/B]. Check the string generated (output of php code) in … | |
Re: Core javascript ajax is headache. Why don't you try jquery ajax. [URL="http://api.jquery.com/jQuery.ajax/"]check here[/URL] Its too easy to operate. | |
Re: [QUOTE=alfredferg;1541972] $myQueryVar1 = mysql_query("DELETE FROM mytable1 WHERE id='$idExecuted'"); $myQueryVar2 = mysql_query("DELETE FROM mytable2 WHERE id='$idExecuted'"); $myQueryVar3 = mysql_query("DELETE FROM mytable3 WHERE id='$idExecuted'"); $myQueryVar4 = mysql_query("DELETE FROM mytable4 WHERE id='$idExecuted'"); $myQueryVar5 = mysql_query("DELETE FROM mytable5 WHERE id='$idExecuted'"); [/QUOTE] The above code is right and should work. What is problem you are … | |
Re: tomato is right. If field is integer then you can direct use php variable but here you have to use single quote. | |
Re: I am still confused what is your exact requirement? Why don't you directly write loop on index.php. What is the use of all.php? | |
Re: If you dont want to use database then you can use one simple txt file for lock and unlock. If master login add text in txt file as 'ON'. Make it 'OFF' when logout. If slave login then read txt file, if it is 'ON' then only slave can login. ![]() | |
Re: Check this... [url]http://www.mekya.com/blog/lang/eng/2010/03/demo-of-editable-jquery-tree-with-php-codes-duzenlenebilir-jquery-agac-yapisinin-demosu/[/url] ![]() | |
Re: svilla is right. Can you please use CODE tags now onwards... | |
Re: Not sure, but try this using eval function. [CODE] var code = document.getElementById('code').value; eval(code); [/CODE] | |
Re: post your code. I use below searching logic: 1. Create join query which will have all five parameters as a result. 2. now create where condition by concatenation. e.g. [CODE] if(isset($_POST['color'])) $where.= " AND table1.color=".$_POST['color']; if() .... [/CODE] 3. So your final query will be. $sql = " select... WHERE … | |
Re: There is no big difference between Mysql and Mysqli. Mysqli is nothing but an improved extension of Mysql which supports OOPS. In some blogs and benchmark says that Mysql is slightly faster than the Mysqli Extension. | |
Re: Try this code. It will print all php configuration. So that you can check existing dlls. [CODE] <?php // Show all information, defaults to INFO_ALL phpinfo(); // Show just the module information. // phpinfo(8) yields identical results. phpinfo(INFO_MODULES); ?> [/CODE] | |
| |
Re: I think you are talking about HTML table. You can fix the width of table. You need to post your code for review. PLEASE USE CODE TAGS. | |
Re: I think its not because of space. Your href link must start with http:// to work in browser. When you click on link what is url shown in browser? | |
Re: Code is looking w/o error. can you check $tbl_name variable in both page. | |
Re: APC is a PECL Extension Try Getting the package and install for more info on apc Extension [url]http://pecl.php.net/package/APC[/url] | |
Re: On onclick event of button you can call one js function. In js function call ajax to increment click counter. | |
Re: Yes urtrivedi is right. you can always use `(escape) character around table name to avoid it. [CODE] ..... INSERT INTO `join` [/CODE] | |
Re: If you have object for database then that function can be used. otherwise, [CODE] <? function deleteEntry() { return mysql_query("delete from manage where entryId='".$this->entryId."'") or die(mysql_error());//delete $this->entryId from database } ?> [/CODE] | |
Re: 1. count distance between x and y point. 2. check wheather it is less than radious (y is inside) it is greater than radious (y is outside) | |
![]() | Re: try without single quote. [CODE]in_array($user_em,$pieces)[/CODE] ![]() |
Re: 1. session_start(); must be on the first line of coding. 2. where is $_SESSION['key'] defined? 3. you have to check user's entered code with session captcha code on add_enquiry.php page. Because your form action is 'add_enquiry.php' which will directly executed code without checking captcha. | |
Re: You have to use absolute path. You can define one php variable and use it in js, image, css path. [CODE] $siteurl = 'http://www.site.com'; [/CODE] <img src="<?=$siteurl?>/images/test.jpg"> | |
Re: Check this code. And implement as per your need. [CODE] <script language="javascript"> function valid(form) { if(form.name.value=="") { alert('Please enter name'); return false; } else if(form.subject.value=="") { alert('Please enter subject'); return false; } else { return true; } } </script> <form name="frm" id="frm" method="post" onsubmit="return valid(this);"> <br />Name : <input name="name" … | |
Re: Why don't you toggle both layout. Here is code for that. [CODE] <script language="javascript"> function changeText() { document.getElementById('layout1').style.display = 'none'; document.getElementById('layout2').style.display = 'block'; } function resetText() { document.getElementById('layout2').style.display = 'none'; document.getElementById('layout1').style.display = 'block'; } </script> <div id="to_change_into_image" class="box"> <div id="layout1"> <h1>Table for layout</h1> <table class="table_for_layout"><!--OUTER TABLE--> <tbody><tr> <td></td><td colspan="2"><p><br></p><h2>Web editing … | |
Re: [CODE] <?php $subject = "<a href='google.com'>Google link</a>"; $pattern = "/url|link|href/"; preg_match($pattern, substr($subject,3), $matches, PREG_OFFSET_CAPTURE); print_r($matches); ?> [/CODE] | |
Re: [CODE] <?php // the HTML source of a URL. $lines = file('http://www.google.com/'); // Loop through our array, show HTML source as HTML source; and line numbers too. foreach ($lines as $line_num => $line) { echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n"; } ?> [/CODE] | |
![]() | Re: You can design your database this manner: [CODE] commentId| parentCommentId |user |comment 1 | 0 |XYZ |hsdahfkasydf astdfsa dftasdf astdfasdf 2 | 1 |TYU |why you writing wirdo? 3 | 1 |IOP |wtf! 4 | 0 |VBN |I love daniweb. 5 | 4 |DFG |me too. [/CODE] ![]() |
Re: [CODE] function check() { var a = document.getElementById('name').value; var b = document.getElementById('address').value; if( a =="" || b==""){ alert("Input fields can not be empty"); return false; } return true; } [/CODE] Where name and address is id of the fields. | |
Re: Here is a query. [CODE] SELECT name, count( * ) FROM `student` WHERE 1 GROUP BY name [/CODE] | |
Re: Also use value in option tag. Because it may cause issue in IE. [CODE] <?php // your database connection here echo "<select name='dropdown1'>"; $query = mysql_query("SELECT * from employeedetails"); while($result=mysql_fetch_array($query)); { echo "<option value='".$result['EmployeeID']."' name='id_list'>".$result['EmployeeID']."</option>"; } echo "</select>"; ?> [/CODE] |
The End.