[Solved] Words extraction [closed]

preg_match_all(‘/[a-z]+:\/\/\S+/’, $string, $matches); This is an easy way that’d work for a lot of cases, not all. All the matches are put in $matches. Here is a link on using regular expressions in PHP: http://www.regular-expressions.info/php.html. Also, here is a link for email regular expressions: http://www.regular-expressions.info/email.html Good luck. 1 solved Words extraction [closed]

[Solved] How to fetch all data from database? [closed]

DO NOT USE MYSQL, instead use MySQLi as MySQL is DEPRECATED . But: $tid=$_SESSION[‘id’]; $a=mysql_query(“select * from tbl_curriculum_sched where TEACHER_ID=’$tid'”) or die(“$ a error : “.mysql_error()); while($ad=mysql_fetch_array($a)){ $sql= mysql_query(“SELECT * from enrolled where CURRICULUM_SCHED_ID=’$ad[0]'”) or die(“inner while: “.mysqli_error()); … To those of you commenting and comlaining that the OP should be using $a, rather than … Read more

[Solved] How I Can Use Multi Table for While my data in php? [closed]

Here is a query writen to get all rows from your table. //connect to database $dbhost=”localhost”; $dbuser=”root”; $dbpass=””; $dbname=”databasename”; $conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname, $conn) or die (‘connection problem’); $html=””; $sql = “” . ” SELECT * FROM customer, sell, control ” . “”; $data = mysql_query($sql); if (mysql_num_rows($data) > 0) { $html .= … Read more

[Solved] Converting a large ASCII to CSV file in python or java or something else on Linux or Win7

If you are absolutely certain that each entry is 92 lines long: from itertools import izip import csv with open(‘data.txt’) as inf, open(‘data.csv’,’wb’) as outf: lines = (line[2:].rstrip() for line in inf) rows = (data[1:89] for data in izip(*([lines]*92))) csv.writer(outf).writerows(rows) 1 solved Converting a large ASCII to CSV file in python or java or something … Read more

[Solved] Save position of element with Jquery, PHP and MySQL [closed]

I don’t know what do mean by “saving position of an element” and how can that be useful, but you can try jQuery position() and $.ajax() methods: Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. var t = $(‘a.icon’).position().top; var l = $(‘a.icon’).position().left; $.ajax({ … Read more

[Solved] A PHP selection based on forms [closed]

Use a hidden Ratio for your option .. and use trigger click in JavaScript $(‘.option_one_div’).click(function(){ $(‘.option_one_Ratio’).trigger(‘click’); }); and then check for Ratio checked in your form when submit 3 solved A PHP selection based on forms [closed]

[Solved] How to compare two variables in php

I want to compare coming get variable with nursery But then you are comparing with Nursery if ($results==”Nursery”) Are you aware that that comparison is case-sensitive? Also that code is poor. It should simply be $results=isset($_GET[‘results’]) ? $_GET[‘results’] : NULL; Do not use error suppression when you are learning something new. And Oh, How can … Read more

[Solved] php function is not working? [closed]

In your case there are too many unknowns. First of all you must enable a proper error reporting level and – only for development – let the errors be displayed on screen. Second, there are important error/failure situations which you are not covering with your exception handling code. Also, I would use bindValue() instead of … Read more

[Solved] PHP – Why there is a difference in the output of the echo statement and the print_r() function when viewed in a browser? Please explain

PHP – Why there is a difference in the output of the echo statement and the print_r() function when viewed in a browser? Please explain solved PHP – Why there is a difference in the output of the echo statement and the print_r() function when viewed in a browser? Please explain

[Solved] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”’)

No need to use single quote with table name(‘operations’) & specify table name with row like groupName.operations, group_ID.operations. 2 solved You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”’)