I do not want anything like DROP TABLE to work or any type of coding..
Heres my code.. is it secure? if not, please help:
Code: <?php
mysql_connect('','','');
mysql_select_db('cars');
if(preg_match("/^[ a-zA-Z 0-9 &]+/", $_POST['q'])){
$q = $_POST['q'];
$q = addslashes(mysql_real_escape_string($q));
$result = mysql_query("SELECT * FROM parts WHERE MATCH (`category`,`name`,`description`) AGAINST ('$q' IN BOOLEAN MODE)");
$num_results = mysql_num_rows($result);
echo 'Found '.$num_results.' parts matching '.$q.'.';
if($num_results>0) {
$row['name'] = stripslashes(stripslashes($row['name']));
$row['description'] = stripslashes(stripslashes($row['description']));
echo '<p>'.$row['name'].'</a>
<img src="'.$row['thumbnailurl'].'"><br />'.$row['description'].'<br />'.$row['date'].'</p>';
}
}
else {
echo '<p>Their were 0 results for '.$q.'! Try again?</p>';
}
}
else {
echo '<p>TEXT ONLY PLEASE</p>';
}
?>
Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data displayed on the bar graph .The problem is that Y-axis of the chart resizes in function to the
Alternate messaging
I have 4 strings in MySQL db1$string1 : Hello$string2 : Hi$string3 : Great$string4 : ThanksAnd I have 3 accounts MySQL db2$User1 : $Pw1$User2 : $Pw2$User3 : $Pw3expected result---------------Hello
mysq_num_rows
Hi,I want to use:Code: if(mysql_num_rows($ergebnis2)==2)how can the value 2, be retrieved from the database?example, lets say I have ifCode: (mysql_num_rows($ergebnis2)==$limit)$limit =
Undefined offset when using a flat file with pipe symbols
Hi, I've got a flat file/text file which I'm currently using as a member database for my site (not advisable I know.. but still learning here).In a section of code I need to separate the fields to
getting most records by count
Code: [Select]<?php $connect = mysql_connect("localhost","damgears_evil","damgears"); mysql_select_db("damgears_evil"); $queryreg =
want to add a break after a certain amount of characters
i was wondering how to add a break in a blog post after a certain amount of characters... any idea on how to do this???this is the code i'm workig with<?php$connect =
Intrastat Report Config in ECC 6.0 - goods Movement in EU countries
Colleagues, need ur help to understand the changes require in ECC 6 standard Report configuration settings.
Delete all files in folder except with certain name
I have a script that I want to delete all files in a folder (taken from a database) except for one named thumb1.jpgI have this, but this deletes all the files and a subfolder if there is one. How can
Revoking alter any table from a schema
Hi All,
Empty text file when there is over XXXX lines of text.
define("RANDOM_FILE","/public_html/random.txt"); $randomEntry = "This goes in text file.\n"; { $randomFile = fopen(RANDOM_FILE,"a"); }