1)
my php coding
Code: Select all
if ($Future == 'NS') {
***coding A
}Code: Select all
<h3><input type="radio" value="NS" name="Future">NS</h3>
<h3><input type="radio" value="work" name="Future">Work</h3>2)
Code: Select all
if (!((strng.search(/[a-z]+/) > -1) && (strng.search(/[0-9]+/) > -1))) {
***coding
}
3)
I looked through the net and found this email address validation coding.
Code: Select all
if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $Email)) {
die ('Invalid email address');
}I dunno wat's wrong with it.
4)
Is it possible for a insert php coding to be like this?
Code: Select all
$sql4="INSERT INTO studies (matric_no, Course_name, institution_name, Country, Studies_Description) VALUES ('$_POST[matric_no]','Nil','Nil','Nil','Nil')";
5)
Code: Select all
$sql2 = "Select * FROM jobs WHERE matric_no LIKE '%$matric_no%' ORDER BY Job_Start_Date";
$query2 = mysql_query($sql2, $con);
if(!$query2)
{
die('Error: ' . mysql_error());
}
print "<table border=2>";
while ($result2 = mysql_fetch_array($query2))
{
extract($result2); // assigns $ variables for all the elements in the array
print"<tr>";
print "<td><b>Job Industry</b></td> <td>$Job_Industry</td>";
print"<tr></tr>";
print "<td><b>Job Company Name</b> </td> <td>$Job_Company</td>";
print "<tr></tr>";
print "<td><b>Job Position</b></td> <td>$Job_Position</td>";
print"<tr></tr>";
print "<td><b>Job Department</b></td ><td>$Job_Department</td>";
print "<tr></tr>";
print "<td><b>Job Description</b> </td> <td>$Job_Description</td>";
print "<tr></tr>";
print "<td><b>Job Start Date</b> </td> <td>$Job_Start_Date</td>";
print "<tr></tr>";
print "<td><b>Job End Date</b> </td> <td>$Job_End_Date</td>";
print "<tr></tr>";
print "<br /><br />
///print studies table information
$sql3 = "Select * FROM studies WHERE matric_no LIKE '%$matric_no%'";
$query3 = mysql_query($sql3, $con);
if(!$query3)
{
die('Error: ' . mysql_error());
}
print "<table border=2>";
while ($result3 = mysql_fetch_array($query3))
{
extract($result3); // assigns $ variables for all the elements in the array
print"<tr>";
print "<td><b>Course Name</b></td> <td>$Course_Name</td>";
print"<tr></tr>";
print "<td><b>Institution Name</b> </td> <td>$institution_name</td>";
print "<tr></tr>";
print "<td><b>Country</b></td> <td>$Country</td>";
print"<tr></tr>";
print "<td><b>Course Description</b></td ><td>$studies_Description</td>";
print "<tr></tr>";
print "<br /><br />
6)
I have a search php coding.
Code: Select all
$sql = "SELECT * FROM Student WHERE ";
foreach($_POST as $key => $value) {
if(isset($value)) {
$sql .= "`$key` LIKE '%$value%' AND ";
}
}
$sql = substr($sql,0,strripos($sql," AND "));
$query1 = mysqli_query($conn, $sql) or die("Query failed! " . mysql_error() . "<br>". $sql);
Hmm that's all my doubts. I been troubled by these and delaying my progress. Could any experts or anyone clear my confusion? I really need help.
Thanks alot.