- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 9
- Posts with Downvotes
- 7
- Downvoting Members
- 7
21 Posted Topics
Re: use die(mysql_error()) next to mysql_query(). Due to this you can check your query runs correctly or not. Before insert values into ddatabase, just echo the values wheather it display or not. If it displayed, then you need to find error on your query | |
Re: You can use this code to upload images to database using PHP <form action="#" method="post" enctype="multipart/form-data"> File: <input type="file" name="file"> <input type="submit" name="submit" value="Upload"> </form> <?php if(isset($_POST['submit'])) { mysql_connect('localhost','root',''); mysql_select_db('new'); $name=$_FILES['file']['name']; $type=$_FILES['file']['type']; if($type=='image/jpeg' || $type=='image/png' || $type=='image/gif' || $type=='image/pjpeg') { if(file_exists(dirname($_SERVER['DOCUMENT_ROOT']).'/oops/upload/image/'.$name)) { echo'file is already present'; } else { $up=move_uploaded_file($_FILES['file']['tmp_name'],dirname($_SERVER['DOCUMENT_ROOT']).'/oops/upload/image/'.$name); … | |
Re: use this code <?php header("Content-Type: application/rss+xml; charset=ISO-8859-1"); echo '<?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?> <?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?> <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"> <channel> <title>title</title> <link>http://www.sample.com</link> <description>Description</description>'; $connection = @mysql_connect('localhost', 'root', '') or die(mysql_error()); mysql_select_db('new') or die (mysql_error()); $query = "SELECT * FROM links … | |
Re: User-agent: * Disallow: / Now, the search engine don't crawl and index your pages. You add this code to your robots.txt file. Your robots.txt file should be present in root directory of your websites | |
Re: <?php if(isset($_POST['submit'])) { $mail=$_POST['mail']; $q=mysql_query("select * password from register where mail='".$mail."' ") or die(mysql_error()); $res=mysql_fetch_assoc($q); $password=$res['password']; $msg='Your password is '.$password; $sub='Send password'; $header='From: your mail id'; $m=mail($mail,$sub,$msg,$header); if($m) { echo'check your mail'; } } ?> | |
Re: Order by and group by are totally different. **Order by** It is used to sort the table values ascending and descending order for ex: select * from table_name order id desc where, fields are sorts descending order **Group by** It is used to display distinct values on table. It eliminate … | |
Re: SELECT * FROM ( SELECT * FROM `mail` ORDER BY send_date DESC ) t GROUP BY message_id | |
Re: select * from table where DATE(field)='yyyy-mm-dd' | |
Re: **Insert into table2 (column_name1, column_name2) select column_name1, column_name2 from table1 where column_name1='value'** | |
Re: <form action ="#" method="post" > <input type ="text" name="name" /> <input type ="submit" name="submit" value="submit" /> </form> <?php if(isset($_POST['submit'])) $link = mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("db_name") or die(mysql_error()); $result = mysql_query("insert into tablenmae values('".$_POST[name]."')") or die(mysql_error()); if($result) { echo "values inserted."; } else { echo'Not inserted'; } ![]() | |
Re: You need to use insert mysql query to insert values into database. | |
Re: You've to check your query first wheather it gives answer or not. $result = mysql_query("SELECT * FROM stadium WHERE gametime = `$_z`") or die(mysql_error()); $row = mysql_fetch_row($result); $bababa[name] = $row[0]; $bababa[town] = $row[1]; $bababa[playingA] = $row[2]; $bababa[playingB] = $row[3]; $bababa[3] = $row[4]; | |
Re: RewriteEngine on RewriteRule ^(.*)$ index.php?url=$1 [L] | |
Re: You will try to use this RewriteRule ^(.*)$ profile.php?username=$1 [L] Then in your profile.php $username=$_GET['username']; | |
Re: It means your query contains white space. To avoid this problem you need to add **mysql_real_escape_string($val)** ie, mysql_query("select id from grupe where grupanaziv ='".mysql_real_escape_string($grupa_select)."'"); | |
![]() | Re: **GET:** When you submit a form usig GET method, you can see the values you entered in address bar. For example, you enter your user name and password, You can see it on address bar. So its not a secure way. To avoid this problem. you have to use POST … |
Re: This is the query for copy values from one table to another in mysql Insert into table2 (column_name1, column_name2) select column_name1, column_name2 from table1 | |
Re: RewriteEngine On RewriteRule ^user/(.*)$ index.php?user=$1 [L] | |
Re: Your mysql query return no values. So you got this error. To avoid this error, you need to add die(mysql_error()) after your query ie, mysql_query("select * from tbl_name") or die(mysql_error()); If the query is not correct, then it give error message. Now you can know whether your query return values … | |
Re: **mysql_fetch_array:** Mysql_fetch_array() returns row as an associative, numeric array or both based on parameters passed in it. Three types of parameters can be passed in mysql_fetch_array function. 1. MYSQL_BOTH - return both associative and numeric array 2. MYSQL_ASSOC - return associative array 3. MYSQL_NUM - return numeric array **mysql_fetch_assoc():** It … | |
Re: Robots.txt is a text file which is used to instruct the search engines for how to crawl and index the pages on your site. The search engines should be obey the robots.txt. The search engine follow the instruction specified by robots.txt file. If you want to some of your pages … |
The End.