<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>MySQL Forums - PHP</title>
        <description>Forum for MySQL and PHP.</description>
        <link>http://forums.mysql.com/list.php?52</link>
        <lastBuildDate>Wed, 22 May 2013 18:57:46 +0000</lastBuildDate>
        <generator>Phorum 5.2.19</generator>
        <item>
            <guid>http://forums.mysql.com/read.php?52,586849,586849#msg-586849</guid>
            <title>sum alias column (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,586849,586849#msg-586849</link>
            <description><![CDATA[ i have query:<br />
SELECT SUM( nilai.pilih1 ) as kpilih1, <br />
       SUM( nilai.pilih2 ), <br />
       soal.jwba, <br />
       soal.jwbb, <br />
       soal.jwbc, <br />
       soal.jwbd, <br />
       nilai.nilai as nilai, <br />
       nilai.catatan as catatan <br />
	<br />
       CASE WHEN nilai.nilai = 4 THEN '1'<br />
                    ELSE '0'<br />
              END AS 'tali1',<br />
	CASE WHEN nilai.nilai = 3 THEN '1'<br />
                    ELSE '0'<br />
              END AS 'tali2',<br />
        CASE WHEN nilai.nilai = 2 THEN '1'<br />
                    ELSE '0'<br />
              END AS 'tali3',<br />
        CASE WHEN nilai.nilai = 1 THEN '1'<br />
                    ELSE '0'<br />
              END AS 'tali4'<br />
<br />
&quot;MY PROBLEM....<br />
get total of tali1, get total of tali2, get total of tali3, get total of tali4,<br />
&quot;<br />
<br />
FROM nilai, soal where soal.idkat = '$program' and soal.standar = '$standar' and soal.id_soal = nilai.id_soal group BY soal.id_soal&quot;;<br />
<br />
<br />
<br />
my problem is, ho to sum() alias column from &quot;case&quot; ( sum( tali1 ) get total of tali1, sum( tali2 ) get total of tali2, sum( tali3 ) get total of tali3, sum( tali4 )get total of tali4 ), because mysql can't sum of alias column.<br />
thank's]]></description>
            <dc:creator>agus afryadi</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 22 May 2013 04:35:32 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,586701,586701#msg-586701</guid>
            <title>Create Definer wildcard and login issue (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,586701,586701#msg-586701</link>
            <description><![CDATA[ Hi,<br />
this is my first question here and I honestly made it after long investigation without answers.<br />
<br />
I have created an intranet web application that run on a CentOS web server, the application use another local server (always CentOS) for the mysql database.<br />
<br />
Inside the database I have created routines wich every start like this:<br />
<br />
CREATE DEFINER='renato'@'192.168.0.%' PROCEDURE 'CreateUser'<br />
or<br />
CREATE DEFINER='renato'@'192.168.0.%' PROCEDURE 'LoginUser'<br />
<br />
<br />
Until here all is ok the application is working on 192.168.0.5 which is the IP of the server where application is installed.<br />
<br />
Now some days ago as the server that run the application is an old one, to add another server (I mean commodity server), what I was thinking is to do a Round Robin balance.<br />
<br />
So I have added to the network another server (192.168.0.6) and set a round robin balance with a TTL of 1 minute.<br />
<br />
And here is the issue, if I login to the system there is no problems since round robin let me login on first or second server, but when I'm inside the application and for example open another link like subdomain the round robin send me on the second server and force me to relogin.<br />
<br />
So it's like I can login correctly on one of the two server, but I have to stay on that server I have logged in, otherwise it will force me to login again.<br />
<br />
<br />
I really don't understand where is the issue, since on the database I have set the wildcard.<br />
<br />
<br />
Thanks in advance for help<br />
Renato]]></description>
            <dc:creator>Renato Di Martino</dc:creator>
            <category>PHP</category>
            <pubDate>Mon, 20 May 2013 03:31:26 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,586341,586341#msg-586341</guid>
            <title>ubuntu 12.04 php 5.3 and mysql 5.5.31 did not work call store procedure (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,586341,586341#msg-586341</link>
            <description><![CDATA[ Good day. Please if you know tell me what i am doing wrong. Sorry for my bad English. LAMP server Ubuntu 12.04, MySQL Server 5.5.31, PHP 5.3.10, Apache 2.2 with virtual host, doing simple query in store procedure: select * from table1, but in php script when i doing $res = mysqli_query(&quot;Call proc1();&quot;); while ($row =mysqli_fetch_assoc($res)) { var_dump($row)}; empty result, even i doing mysqli_query(&quot;Select * from table1;&quot;) empty result(((. What happen. May be someone know?]]></description>
            <dc:creator>Игорь Владимирович</dc:creator>
            <category>PHP</category>
            <pubDate>Thu, 16 May 2013 18:00:39 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,586102,586102#msg-586102</guid>
            <title>problem in selest asterisk mysql table's fields (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,586102,586102#msg-586102</link>
            <description><![CDATA[ hi to all<br />
dear friends<br />
i wana have a show from some fields of asterisk mysql database (asteriskcdrdb(cdr table)) in a certain date for example from 2013-4-1 till 2013-5-1<br />
as you know asterisk records all calls information in this table like : calldate,src,dst,duration and ...<br />
i wana show all calls of one extension like 3004 in a certain date <br />
i want all records that 3004 is in src field and 3004 is in dst field(all dialed and recieved calls)<br />
i use below query:<br />
<br />
select calldate, src, dst from cdr where calldate between 2013-4-1 and 2013-5-1 and src = '3004' or dst='3004';<br />
<br />
the problem is in the result<br />
results do not belong to that date, acctually it shows all calls that 3004 dialed and recieved from the first day that extension creats till today,<br />
its imporatant for me to show results in a specific date<br />
please help me<br />
and if my query has any problem please correct it<br />
plzzzzzzzzzzz]]></description>
            <dc:creator>Mohammad Nemati Habili</dc:creator>
            <category>PHP</category>
            <pubDate>Sun, 12 May 2013 21:55:55 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,585761,585761#msg-585761</guid>
            <title>Script that recognises the name of a column in a CSV file and matches it to the correspondent column, with the same name, in a MySql database (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,585761,585761#msg-585761</link>
            <description><![CDATA[ we are using PHP and MySql for our application.<br />
<br />
Problem:<br />
<br />
we get some data, we put them in a CSV file, we upload them in our database through a template, then we upload the data online.<br />
<br />
we have many CSV files with different fields' order and some fields are empty, for example:<br />
<br />
CSV1 has the following fields order: name, description, date, address, phone<br />
CSV2 has the following fields order: address, description, name, date<br />
CSV3 has the following fields order: name, address<br />
To upload these data in our database (and then online), we now need to have all the CSVs' fields always in the same order, so for example: name, descrition, phone, address, date. To do this we need to manually move the columns in the CSVs.<br />
<br />
My question is:<br />
<br />
if the CSV files have the columns in a different order (but with the same field names), is it possible to match a CSV column to its right position in the database, without having to manually edit the position of the columns in the CSV?<br />
<br />
So basically a script that recognise the name of a column in a CSV file (for ex. address) and match it (and its content) to the correspondent column in our MySql database.<br />
<br />
Many thanks, Sarah]]></description>
            <dc:creator>Sarah Raniero</dc:creator>
            <category>PHP</category>
            <pubDate>Thu, 09 May 2013 02:10:01 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,585720,585720#msg-585720</guid>
            <title>Getting many error in error_log file. (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,585720,585720#msg-585720</link>
            <description><![CDATA[ Hi Guys....<br />
<br />
Does anyone have any idea, why I am getting this in my apache log file......<br />
<br />
PHP Warning:  PDO::__construct(): [2002] Cannot assign requested address (trying to connect via tcp://ec2-184-72-144-105.compute-1.amazonaws.com:3306) in...................]]></description>
            <dc:creator>Dilshad Hussain</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 08 May 2013 13:41:36 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,585688,585688#msg-585688</guid>
            <title>Referencing Images (8 replies)</title>
            <link>http://forums.mysql.com/read.php?52,585688,585688#msg-585688</link>
            <description><![CDATA[ First off, thanks to anyone will to spend a moment to reply to my question...<br />
<br />
<br />
I'm self-taught in HTML and CSS and have coded half-a-dozen websites without any problems. My latest site, however, will have hundreds of pages, each with identical layout (HTML code) except that a single image displayed will be unique to each page. It's a comic strip, so everything around the actual image is the same, but I do need unique addressed that can be referenced for each unique page, so an image viewer is out. <br />
<br />
Reading up, I decided that a CMS / database-driven site was what I needed. I tried Wordpress and hate it with a passion, and really just want only the code that I need for this simple task. How hard could it be, right?<br />
<br />
So... I bought the book &quot;Murach's PHP and MySQL&quot; <a href="http://www.amazon.com/Murachs-PHP-MySQL-Murach-Reference/dp/1890774561/ref=sr_1_1?ie=UTF8&amp;qid=1367961628&amp;sr=8-1&amp;keywords=murach%27s+PHP"  rel="nofollow">http://www.amazon.com/Murachs-PHP-MySQL-Murach-Reference/dp/1890774561/ref=sr_1_1?ie=UTF8&amp;qid=1367961628&amp;sr=8-1&amp;keywords=murach%27s+PHP</a><br />
<br />
... and I'm halfway through it when I realized, although the book is ok, and I'm learning a lot of stuff that's way more complex than what I'll be doing, I'm not actually learning the only thing I need. I flipped around and I realized I'm in over my head at this point.<br />
<br />
<br />
Can anyone point me to some sample PHP code or tutorials for what I'm looking for?<br />
<br />
I just want to be able to use a single HTML page that only swaps the image when a user clicks a link to another page. The reason I want this is because there will be 100s of pages over time, and I'll want to be able to update the HTML as needed without opening and altering 100 files. But I don't need all the other crazy stuff that comes with these all-in-one CMS systems.<br />
<br />
Or if anyone has a better idea, I'd really love to hear it.<br />
<br />
Again, thanks for anyone's guidance!]]></description>
            <dc:creator>Jay Ogre</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 08 May 2013 21:03:37 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,585341,585341#msg-585341</guid>
            <title>application with php and myadmin (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,585341,585341#msg-585341</link>
            <description><![CDATA[ Hi everyone iam developping an application with php and mysql  but i want to use oracle 11g for the datawarehouse can someone help me about how to proceed???? plz help]]></description>
            <dc:creator>Bodelère ASSOKPE</dc:creator>
            <category>PHP</category>
            <pubDate>Sat, 04 May 2013 19:40:45 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,585252,585252#msg-585252</guid>
            <title>inserting csv data into mysql table using PHP (2 replies)</title>
            <link>http://forums.mysql.com/read.php?52,585252,585252#msg-585252</link>
            <description><![CDATA[ Just looking for some advice on the best way to go about inserting some data(and in the future updating) from a csv file into a mysql db table.<br />
<br />
My server doesnt allow the command load data infile so using php just not sure the best approach as my csv file has less columns than the table and different headers than the table.<br />
<br />
eg<br />
<br />
CSV FILE<br />
<br />
'PRODUCT_ID', 'PRICE', 'STOCK', 'DESCRIPTION'<br />
<br />
table<br />
<br />
products_id, products_price, products_stock, products_status, ect , ect,<br />
<br />
Im guessing creating an array from the csv and assigning each column as a $variable then mapping this to the relevant columns in the table then inserting.<br />
<br />
there are so many ways to go about the same thing just wanted a bit of advice on which route to take.<br />
<br />
thanks for your time.<br />
<br />
John.]]></description>
            <dc:creator>John Spencer</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 01 May 2013 16:14:10 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,585104,585104#msg-585104</guid>
            <title>Seeks Improved Efficency: Redundant Query Data (8 replies)</title>
            <link>http://forums.mysql.com/read.php?52,585104,585104#msg-585104</link>
            <description><![CDATA[ Greetings. I seek your advisory for the following 2-table simple SQL problem. (i believe, simple, that is). Super-details (eg. Table3), i might add later (Eg. producer, writer, credits), but i need to get the thing moving, first. I've tried to use Std MySQL doc terminology, where applicable (Eg. table1.col1 , table2.col2). Please, don't hesitate to tell me what YOU need / wish to know about my task. Thank you!<br />
<br />
Table1, Master:<br />
<pre class="bbcode">CREATE TABLE `cp_master` (
  `master_pk` int(11) NOT NULL AUTO_INCREMENT COMMENT 'master table primary key',
  `master_date` date NOT NULL,
  `master_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`master_pk`),
  UNIQUE KEY `master_date` (`master_date`,`master_timestamp`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8</pre>
Table2, Details:<br />
<pre class="bbcode">CREATE TABLE `cp_details` (
  `details_pk` int(11) NOT NULL AUTO_INCREMENT,
  `details_fk` int(11) NOT NULL COMMENT 'insert foreign key',
  `details_date` date NOT NULL,
  `details_toonname` tinytext NOT NULL,
  `details_toonepi` tinytext NOT NULL,
  `details_toontime` time NOT NULL,
  PRIMARY KEY (`details_pk`),
  KEY `details_fk` (`details_fk`,`details_date`)
) ENGINE=MyISAM AUTO_INCREMENT=54 DEFAULT CHARSET=utf8 COMMENT='Cartoon Planet: Details'</pre>
This is a private/ personal DB created for Mgt of DVR media (indeed, @cartoonNetwork’s Cartoon Planet. yikes!).<br />
<br />
Using phpMyAdmin to create / admin the thing, i find these queries are quite redundant. Having been much more active in the DB Admin game, years ago in my studies, i'm a bit rusty in terms of <br />
<b>“How might I minimize my query, while maintaining equal results?”</b><br />
<br />
E.G.<br />
<pre class="bbcode">INSERT INTO `cartoonplanet`.`cp_details` 
(`details_pk`, `details_fk`, `details_date`, `details_toonname`, `details_toonepi`, `details_toontime`)
 VALUES 
(NULL, '11', '2013-04-05', 
'Courage the Cowardly Dog', 'Klub Katz', '00:27:30');</pre>
<b>My thoughts:</b><br />
<b>First</b>, the timestamp on the master. It's superfluous, from any perspective, truly. I don't /really/ need to know at what time X was entered to Y, etc., but knowing i've usually used TimeStamps for indexing, etc., i stuck it there. Whatever: likely NOT at issue (and would have been of more use, had I placed it instead, in the Table2.)<br />
<b>Second</b><br />
I'm looking at the query, thinking: i've got a PK (Eg. 11, in the code above), and an index (Eg. 2013-04-05). This is what bothers me. I don't really need both, in my Table2 INSERT Query.<br />
<b>At the crux</b><br />
In addition to your valued advisory, RE optimization (Eg. you should have placed A at B, and used C instead of D), i wonder: supposing I code a proper interface for this DB, outside of the PMA-zone <b>as ultimately desirable</b>, what is most important, in terms of the data entry, are <pre class="bbcode">table2.`details_date`</pre> and, particular to that bit of data, the <pre class="bbcode">table2.`details_toontime`</pre>, which reflects the counter on the DVR (Eg. 00:30:00 , where 30 -eq 30 mins).<br />
<br />
<b>Summary</b><br />
How might I better submit such a query; prep the table for more efficient PHP; realizing there are multiple perspectives from which to attack this problem, please, how ever you wish to view it, i suspect you understand my general plight.<br />
<br />
I've coded PHP / MySQL queries using LEFT JOIN, and INSERT's using SELECT statements. So, i'm not <i>quite</i> at <i>beginner</i> mode here. I'm seeking some feedback, having no one to bounce the topic-off-of, so to speak, other than ye in the cyberverse. <br />
<br />
When I look at the query, I think: <b>how am I going to manipulate/ USE this data</b>, from a PHP / interface point-of-view. Should I be placing the table2.ForeignKey-Ref (table2.`details_fk`) AND the date-as-index (table2.`details_date`) in EVERY submit?<br />
<br />
I sense i'm encountering a “Which Came First: The Chicken-or-the-Egg scenario”, where my application is going to likely want to See/ rather, Display the dates, not the Keys. <br />
E.G. <pre class="bbcode"> SQL = &quot;INSERT INTO table2 VALUES '','SELECT...','SELECT...','ToonTitle','ToonEpisode','ToonTime'&quot;;</pre>
But, i'm having difficulty <i>wrapping my head around-it</i>, so to speak (ie. it's been so long since i've done such coding, from a completely home-baked recipe).<br />
<br />
Your feedback will be appreciated.<br />
<br />
<b>EDIT: SQL Gathered while working so far</b> (gathering into a new Netbeans project, for some sanity)...<br />
<br />
Insert a new table1.master row:<br />
<pre class="bbcode">$sql = &quot;INSERT INTO `cartoonplanet`.`cp_master` &quot; . 
&quot;(`master_pk`, `master_date`, `master_timestamp`) &quot; .
&quot;VALUES (NULL, \'20XX-XX-XX\', CURRENT_TIMESTAMP);&quot;;</pre>
<br />
Insert a new table2.details row:<br />
<pre class="bbcode">$sql = &quot;INSERT INTO `cartoonplanet`.`cp_details` &quot; .
&quot;(`details_pk`, `details_fk`, `details_date`, `details_toonname`, `details_toonepi`, `details_toontime`) &quot;.
&quot;VALUES (NULL, \'11\', \'2013-04-05\', \'Courage the Cowardly Dog\', \'Klub Katz\', \'00:27:30\');&quot;;</pre>
<br />
Find a Toon by Name:<br />
<pre class="bbcode">$sql = &quot;SELECT * FROM `cartoonplanet`.`cp_details`\n&quot; . 
&quot;WHERE `details_toonname` LIKE \'TOON_NAME\' ORDER BY `cp_details`.`details_pk` &quot; .
&quot;ASC LIMIT 0, 30 &quot;;</pre>
<br />
Show what ToonEpi(sodes) are particular to the date(Index):<br />
<pre class="bbcode">
$sql = 'SELECT *'
        . ' FROM `cp_details`'
        . ' WHERE `details_date` = \'XXXX-XX-XX\';';</pre>
<br />
best regards!]]></description>
            <dc:creator>stanley tweedle</dc:creator>
            <category>PHP</category>
            <pubDate>Tue, 14 May 2013 02:30:30 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,585095,585095#msg-585095</guid>
            <title>cannot connect to mysql server (13) (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,585095,585095#msg-585095</link>
            <description><![CDATA[ basically, i have a web server (apache in centos installed in host B, and want to connect to a MySQL server in host A) both hosts are in the same subnet.<br />
<br />
i can access remote mysql using CLI mysql -u root -h &lt;ip&gt; -p<br />
<br />
but cannot connect to mysql using PHP function mysql_connect()<br />
<br />
i have already disabled SELINUX and system-config-firewall-tui and included below syntax in /etc/my.cnf<br />
<br />
[client]<br />
port =3306<br />
socket = /var/lib/mysql/mysql.sock<br />
<br />
a lot of solutions found in the web tells me to type in the setbool associated with selinux, but the thing is, SELINUX is already disabled.<br />
<br />
the odd thing is, i can connect thru CLI, but not in php function<br />
<br />
also, i have php-mysql in both hosts]]></description>
            <dc:creator>hoff mann</dc:creator>
            <category>PHP</category>
            <pubDate>Mon, 29 Apr 2013 14:34:04 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,584838,584838#msg-584838</guid>
            <title>I'm having extreme difficulty getting my ADD and DELETE buttons to work with PHP and MySQL tables. (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,584838,584838#msg-584838</link>
            <description><![CDATA[ I need to create a PHP page where I can input form data and see what was entered on the same page and another page that is the data output that will show the table with the data entered.  At the bottom of the output page I need a an Update and Delete button for changing and clearing any data in the table.  The sample that I experimented with has the input form at the top and the records underneath and the delete button looping at the end of each record row.  After experimenting, I separated the coding for the input and output on two separate pages.  I got the button out of the loop to just show at the bottom for the delete, but then the data in the table will not show and the delete button doesn't work.  The same with the add button on the input form.  It now will not add and I'm not sure what I did wrong.  I could use help ASAP for I am on a deadline. <br />
<br />
THIS IS WHAT I HAVE FOR THE INPUT FORM:<br />
<br />
&lt;?php // forminput.php<br />
require_once 'login_publications.php';<br />
<br />
<br />
if(isset($_POST['author']) &amp;&amp;<br />
	isset($_POST['title']) &amp;&amp;<br />
	isset($_POST['category']) &amp;&amp;<br />
	isset($_POST['year']) &amp;&amp;<br />
	isset($_POST['isbn']))<br />
	<br />
{<br />
	$author=get_post('author');<br />
	$title=get_post('title');<br />
	$category=get_post('category');<br />
	$year=get_post('year');<br />
	$isbn=get_post('isbn');<br />
	<br />
	$query= &quot;INSERT INTO classics VALUES&quot; .<br />
		&quot;('$author','$title','$category','$year','$isbn')&quot;;<br />
	<br />
	if(!mysql_query($query, $db_server))<br />
		echo &quot;INSERT failed: $query&lt;br /&gt;&quot; .<br />
		mysql_error() . &quot;&lt;br /&gt;&lt;br /&gt;&quot;;<br />
}<br />
<br />
echo &lt;&lt;&lt;_END<br />
&lt;form action=&quot;formoutput.php&quot; method=&quot;post&quot;&gt;&lt;pre&gt;<br />
  Author &lt;input type=&quot;text&quot; name=&quot;author&quot; /&gt;<br />
   Title &lt;input type=&quot;text&quot; name=&quot;title&quot; /&gt;<br />
Category &lt;input type=&quot;text&quot; name=&quot;category&quot; /&gt;<br />
    Year &lt;input type=&quot;text&quot; name=&quot;year&quot; /&gt;<br />
    ISBN &lt;input type=&quot;text&quot; name=&quot;isbn&quot; /&gt;<br />
	     &lt;input type=&quot;submit&quot; value=&quot;ADD RECORD&quot; /&gt;<br />
&lt;/pre&gt;&lt;/form&gt;<br />
_END;<br />
<br />
function get_post($var)<br />
{<br />
	return mysql_real_escape_string($_POST[$var]);<br />
}<br />
?&gt;<br />
<br />
THIS IS WHAT I HAVE FOR THE OUTPUT FORM:<br />
<br />
&lt;?php output.php<br />
require_once 'login_publications.php';<br />
<br />
if (isset($_POST['author']) &amp;&amp;<br />
(isset($_POST['title']) &amp;&amp;<br />
(isset($_POST['category'])) &amp;&amp;<br />
(isset($_POST['year']) &amp;&amp;<br />
(isset($_POST['isbn']))<br />
<br />
//These two query lines is where I am stuck and after adding the above ISSET and this query statement, I lost the data.<br />
$query = &quot;SELECT * FROM classics&quot;;<br />
$result = mysql_query($query);<br />
<br />
<br />
if (!$result) die (&quot;Database access failed: &quot; . mysql_error());<br />
$rows = mysql_num_rows($result);<br />
<br />
echo &quot;&lt;table&gt;&lt;tr&gt;&lt;th&gt;Author&lt;/th&gt;&lt;th&gt;Title&lt;/th&gt;&lt;th&gt;Category&lt;/th&gt;&lt;th&gt;Year&lt;/th&gt;&lt;th&gt;ISBN&lt;/th&gt;&lt;/tr&gt;&quot;;<br />
<br />
for ($j = 0 ; $j &lt; $rows ; ++$j)<br />
{<br />
	$row = mysql_fetch_row($result);<br />
	echo &quot;&lt;tr&gt;&quot;;<br />
	for ($k = 0 ; $k &lt; 5 ; ++$k)<br />
	echo &quot;&lt;td&gt;$row[$k]&lt;/td&gt;&quot;;<br />
	echo &quot;&lt;/tr&gt;&quot;;<br />
}<br />
<br />
echo &quot;&lt;/table&gt;&quot;;<br />
<br />
{ <br />
	$author=get_post('author');<br />
	$title=get_post('title');<br />
	$category=get_post('category');<br />
	$year=get_post('year');<br />
	$isbn=get_post('isbn');<br />
	<br />
$query = &quot;DELETE FROM classics VALUES&quot; .<br />
  &quot;('$author','$title','$category','$year','$isbn')&quot;;<br />
if (!mysql_query($query, $db_server)) echo &quot;DELETE failed: $query&lt;br /&gt;&quot; . mysql_error() .&quot;&lt;br /&gt;&quot;;<br />
}<br />
<br />
echo &lt;&lt;&lt;_END<br />
&lt;form type=&quot;formoutput.php&quot; method=&quot;post&quot;&gt;<br />
&lt;input type=&quot;text&quot; name&quot;record&quot; /&gt;<br />
&lt;input type=&quot;hidden&quot; name=&quot;delete&quot; value=&quot;yes&quot; /&gt;<br />
&lt;input type=&quot;submit&quot; value=&quot;DELETE RECORD&quot; /&gt;<br />
&lt;/form&gt;<br />
_END;<br />
<br />
mysql_close($db_server);<br />
<br />
function get_post($var)<br />
{<br />
	return mysql_real_escape_string($_POST[$var]);<br />
}<br />
<br />
?&gt;<br />
<br />
The original test form that worked perfectly before I dissected it.  <br />
That form included the coding below:<br />
<br />
<br />
&lt;?php // sqltest.php<br />
require_once 'login_publications.php';<br />
<br />
if(isset($_POST['delete']) &amp;&amp; isset($_POST['isbn']))<br />
{<br />
	$isbn = get_post('isbn');<br />
	$query = &quot;DELETE FROM classics WHERE isbn='$isbn'&quot;;<br />
	<br />
	if(!mysql_query($query, $db_server))<br />
		echo &quot;DELETE failed: $query&lt;br /&gt;&quot; .<br />
		mysql_error() . &quot;&lt;br /&gt;&lt;br /&gt;&quot;;<br />
}<br />
<br />
if(isset($_POST['author']) &amp;&amp;<br />
	isset($_POST['title']) &amp;&amp;<br />
	isset($_POST['category']) &amp;&amp;<br />
	isset($_POST['year']) &amp;&amp;<br />
	isset($_POST['isbn']))<br />
	<br />
{<br />
	$author=get_post('author');<br />
	$title=get_post('title');<br />
	$category=get_post('category');<br />
	$year=get_post('year');<br />
	$isbn=get_post('isbn');<br />
	<br />
	$query= &quot;INSERT INTO classics VALUES&quot; .<br />
		&quot;('$author','$title','$category','$year','$isbn')&quot;;<br />
	<br />
	if(!mysql_query($query, $db_server))<br />
		echo &quot;INSERT failed: $query&lt;br /&gt;&quot; .<br />
		mysql_error() . &quot;&lt;br /&gt;&lt;br /&gt;&quot;;<br />
}<br />
<br />
echo &lt;&lt;&lt;_END<br />
&lt;form action=&quot;sqltest.php&quot; method=&quot;post&quot;&gt;&lt;pre&gt;<br />
  Author &lt;input type=&quot;text&quot; name=&quot;author&quot; /&gt;<br />
   Title &lt;input type=&quot;text&quot; name=&quot;title&quot; /&gt;<br />
Category &lt;input type=&quot;text&quot; name=&quot;category&quot; /&gt;<br />
    Year &lt;input type=&quot;text&quot; name=&quot;year&quot; /&gt;<br />
    ISBN &lt;input type=&quot;text&quot; name=&quot;isbn&quot; /&gt;<br />
	     &lt;input type=&quot;submit&quot; value=&quot;ADD RECORD&quot; /&gt;<br />
&lt;/pre&gt;&lt;/form&gt;<br />
_END;<br />
<br />
$query= &quot;SELECT * FROM classics&quot;;<br />
$result=mysql_query($query);<br />
<br />
if(!$result) die (&quot;Database access failed: &quot; . mysql_error());<br />
$rows=mysql_num_rows($result);<br />
<br />
for($a = 0 ; $a &lt; $rows ; ++$a)<br />
{<br />
	$row=mysql_fetch_row($result);<br />
	echo &lt;&lt;&lt;_END<br />
&lt;pre&gt;<br />
  Author $row[0]<br />
   Title $row[1]<br />
Category $row[2]<br />
	Year $row[3]<br />
	ISBN $row[4]<br />
&lt;/pre&gt;<br />
&lt;form action=&quot;sqltest.php&quot; method=&quot;post&quot;&gt;<br />
&lt;input type=&quot;hidden&quot; name=&quot;delete&quot; value=&quot;yes&quot; /&gt;<br />
&lt;input type=&quot;hidden&quot; name=&quot;isbn&quot; value=&quot;$row[4]&quot; /&gt;<br />
&lt;input type=&quot;submit&quot; value=&quot;DELETE RECORD&quot; /&gt;&lt;/form&gt;<br />
_END;<br />
}<br />
<br />
mysql_close($db_server);<br />
<br />
function get_post($var)<br />
{<br />
	return mysql_real_escape_string($_POST[$var]);<br />
}<br />
<br />
?&gt;]]></description>
            <dc:creator>Malinda Smith</dc:creator>
            <category>PHP</category>
            <pubDate>Fri, 26 Apr 2013 00:55:09 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,584733,584733#msg-584733</guid>
            <title>Trouble displaying information from table in PHP, please help. (2 replies)</title>
            <link>http://forums.mysql.com/read.php?52,584733,584733#msg-584733</link>
            <description><![CDATA[ Hi there,<br />
<br />
I'm learning PHP and have come across a problem I'm wondering if one of you can help me with.<br />
<br />
I'm trying to run this code from Addison Wesley PHP and MySQL Web Development 4th Edn. When I try to run it, it comes up with a connection error but when I remove 'books' from line 22 it connects but doesn't seem to display any search results.<br />
<br />
The code can be found here:<br />
<br />
<a href="http://pastebin.com/diff.php?i=b7Zcez2g"  rel="nofollow">http://pastebin.com/diff.php?i=b7Zcez2g</a><br />
<br />
Since then I have tried improving on the way I connect to the code but still receive no results, the new code can be found here:<br />
<br />
<a href="http://pastebin.com/diff.php?i=b7Zcez2g"  rel="nofollow">http://pastebin.com/diff.php?i=b7Zcez2g</a><br />
<br />
I am still very new to PHP and MySQL so would greatly appreciate any help given.<br />
<br />
The information is definitely found in the database as shown here:<br />
<br />
<img src="http://www.uncensoreddesign.co.uk/MySQL%20table.png" class="bbcode" border="0" /><br />
<br />
And the live docs can be found here:<br />
<br />
<a href="http://www.uncensoreddesign.co.uk/php/book-o-rama/search.html"  rel="nofollow">http://www.uncensoreddesign.co.uk/php/book-o-rama/search.html</a><br />
<br />
Many thanks,<br />
<br />
Costa]]></description>
            <dc:creator>Costa Gauci</dc:creator>
            <category>PHP</category>
            <pubDate>Mon, 29 Apr 2013 15:50:15 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,584286,584286#msg-584286</guid>
            <title>Records missing after insert (3 replies)</title>
            <link>http://forums.mysql.com/read.php?52,584286,584286#msg-584286</link>
            <description><![CDATA[ I have a problem with data not inserting into my database.  The application uses PHP's PDO to connect to a MySQL version 5.5.27 server hosted by AWS.<br />
<br />
One of my scripts does some queries, including 3 inserts.  The first insert is fine, but for the second two inserts, no data appears in my table.  These queries are both within functions that are called from various other scripts with no problems.  I have my PDO object set to throw exceptions but no exceptions are thrown.<br />
<br />
The tables I am inserting into both have auto-increment fields, and I am using PDO's lastInsertId method to get the inserted value from these fields, and it does give me a value.  When I check the tables, the auto-increment value of those tables has increased by one, but there is no record under the auto-increment value given to me.<br />
<br />
There is nothing in the MySQL error log, but when I look in the general log, I can see the insert statements.  When I copy and paste them into the MySQL on the console, they run fine and the data is inserted.  I've double checked that my application hasn't started a transaction by called the inTransaction method of the PDO object just before one of the inserts and it came back false.  I've set the max_prepared_stmt_count to 1000 in case I was hitting a limit there but that hasn't helped.<br />
<br />
After trying lots of things, the only way I've managed to get it to work is before running these two queries, I destroy my PDO object then recreate it. So I guess it's something to do with the code that runs before it doing something to my PDO object, but what I don't understand is how MySQL can take two inserts, not produce any errors, give back an auto increment id and increase the auto-increment value of the table, but not actually insert any data!<br />
<br />
All tables are InnoDB and the php is version 5.3.10 running on Ubuntu.  Any help on this would be greatly appreciated as I've run out of things to try to solve this now.]]></description>
            <dc:creator>Paul Nair</dc:creator>
            <category>PHP</category>
            <pubDate>Fri, 19 Apr 2013 20:51:30 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,584276,584276#msg-584276</guid>
            <title>Adding and removing slashes (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,584276,584276#msg-584276</link>
            <description><![CDATA[ Hi I’m in a class being taught PHP and MySql, and I’m posting this question more or less for clarification as to when and how you would use functions that add and remove slashes when inserting/retrieving data from the database. I can’t seem to find solid guidance with my current resources, so let me tell you what I’ve gathered so far, and please either correct me or expand on it so I can get the whole picture.<br />
<br />
The best function to use for adding slashes to a record being inserted into a MySql database is mysqli_real_escape_string(). This much is simple and clear, but my big question here, is do you use this function only for data you intend to store as a string, or for all types including numeric?<br />
<br />
Second question, we’re being taught to use floatval() on floating point numbers before we insert them into the database. Should we use the corresponding function for integer types as well? Anything else I need to know in regards to storing numeric types in a MySql database?<br />
<br />
And lastly, my third major question, is the generic stripslashes() function good to remove slashes from data that you query, or is there a MySql specific one I should use instead? It shouldn’t make a difference I would think in this case, since it just removes the slashes for the purpose of your query. It doesn’t change the actual record in the database, right?<br />
<br />
Any help on clearing all this up, so I can go about doing things the right way before I form any bad habits, would be immensely appreciated :)]]></description>
            <dc:creator>Matt Camill</dc:creator>
            <category>PHP</category>
            <pubDate>Thu, 18 Apr 2013 23:15:31 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,584053,584053#msg-584053</guid>
            <title>pictures from database (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,584053,584053#msg-584053</link>
            <description><![CDATA[ So I've got images' path stored in my database for each object and I want to display the images on my webpage. I though i could do it for each element with following code: <br />
&lt;?php<br />
$con=mysqli_connect(&quot;x&quot;,&quot;x&quot;,&quot;x&quot;,&quot;x&quot;);<br />
// Check connection<br />
if (mysqli_connect_errno())<br />
  {<br />
  echo &quot;Failed to connect to MySQL: &quot; . mysqli_connect_error();<br />
  }<br />
<br />
$result = mysqli_query($con,&quot;SELECT imagesource FROM staff WHERE id=1&quot;);<br />
echo '&lt;img id=&quot;steve&quot; src=&quot;'. $result . '&quot;' . 'alt=&quot;Steve&quot; class=&quot;thumbnail&quot; /&gt;';<br />
<br />
mysqli_close($con);<br />
?&gt;]]></description>
            <dc:creator>Justyna Cala</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 17 Apr 2013 13:39:05 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,583939,583939#msg-583939</guid>
            <title>shows only the end of the code (no replies)</title>
            <link>http://forums.mysql.com/read.php?52,583939,583939#msg-583939</link>
            <description><![CDATA[ Hello <br />
<br />
My code is:<br />
<br />
&lt;?php<br />
$con=mysqli_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;&quot;,&quot;images&quot;);<br />
// Check connection<br />
if (mysqli_connect_errno())<br />
  {<br />
  echo &quot;Failed to connect to MySQL: &quot; . mysqli_connect_error();<br />
  }<br />
<br />
$result = mysqli_query($con,&quot;SELECT * FROM images&quot;);<br />
<br />
while($row = mysqli_fetch_array($result))<br />
  {<br />
  echo $row['name'] . &quot; &quot; . $row['source'];<br />
  echo &quot;&lt;br /&gt;&quot;;<br />
  }<br />
<br />
mysqli_close($con);<br />
?&gt;<br />
<br />
It doesn't display anything on the website except for the ending of php: &quot;; } mysqli_close($con); ?&gt;]]></description>
            <dc:creator>Justyna Cala</dc:creator>
            <category>PHP</category>
            <pubDate>Sun, 14 Apr 2013 14:19:25 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,583873,583873#msg-583873</guid>
            <title>Select data just after insert (5 replies)</title>
            <link>http://forums.mysql.com/read.php?52,583873,583873#msg-583873</link>
            <description><![CDATA[ Hi all,<br />
<br />
I' m developing a php /mysql application.<br />
<br />
I need to run a select query on a table just after an insert to the same table.<br />
<br />
The reason is that the business owner wants to have the user to able to create a record in the table and see almost immideately the refreshed data in a select form object.<br />
<br />
My problem is that the applicaion one time works and the other it does not.<br />
<br />
I was using INNODB tables and i tried to convert them to MyISAM but with no result (i used an alter stetement)<br />
<br />
Does anyone has an idea on my problem?<br />
<br />
Thnka in advance]]></description>
            <dc:creator>Sophokles Zafeiris</dc:creator>
            <category>PHP</category>
            <pubDate>Thu, 18 Apr 2013 02:42:52 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,583652,583652#msg-583652</guid>
            <title>Query is not running Fastly (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,583652,583652#msg-583652</link>
            <description><![CDATA[ Hi,<br />
<br />
    I've around 5.00,000 Records in my Table. Now return a query its not running fastly. Below is the Query. I need to optimize below query for fetching faster records.<br />
<br />
    <br />
SELECT `id` AS company_id, `Company_name`, `City`, `State`, `Country`, `cleaned`, update_user, `date_modified` AS cleaned_date, `delete` FROM data_table_new WHERE date_modified = '2013-04-11' AND MATCH(Country) AGAINST ('India' IN BOOLEAN MODE) AND `cleaned` = 1 AND `delete` = 0 AND `junk` = 0 ORDER BY date_modified DESC;<br />
<br />
Table Structure:<br />
CREATE TABLE IF NOT EXISTS `data_table_new` (<br />
  `id` bigint(20) NOT NULL AUTO_INCREMENT,<br />
  `Company_name` text COLLATE utf8_unicode_ci,<br />
  `Short_Profile` text COLLATE utf8_unicode_ci,<br />
  `Telephone` text COLLATE utf8_unicode_ci,<br />
  `Alt_Telephone` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Alt_Telephone2` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Fax` text COLLATE utf8_unicode_ci,<br />
  `Alt_Fax` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Mobile` text COLLATE utf8_unicode_ci,<br />
  `Alt_Mobile` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Email` text COLLATE utf8_unicode_ci,<br />
  `Alt_Email1` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Alt_Email2` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Website` text COLLATE utf8_unicode_ci,<br />
  `Website1` text COLLATE utf8_unicode_ci,<br />
  `Website2` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Website3` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Address` text COLLATE utf8_unicode_ci,<br />
  `Address2` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Gender` varchar(16) COLLATE utf8_unicode_ci NOT NULL,<br />
  `Contact_Person_FName` text COLLATE utf8_unicode_ci,<br />
  `Contact_Person_LName` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Posting` text COLLATE utf8_unicode_ci,<br />
  `City` text COLLATE utf8_unicode_ci,<br />
  `Zipcode` text COLLATE utf8_unicode_ci,<br />
  `Business_Type` text COLLATE utf8_unicode_ci,<br />
  `Year_of_Establishment` text COLLATE utf8_unicode_ci,<br />
  `Office_Size` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Legal_Status_of_Firm` text COLLATE utf8_unicode_ci,<br />
  `Certification` text COLLATE utf8_unicode_ci,<br />
  `Annual_Turnover` text COLLATE utf8_unicode_ci,<br />
  `Number_of_Employees` text COLLATE utf8_unicode_ci,<br />
  `Export_Percentage` text COLLATE utf8_unicode_ci,<br />
  `Main_Markets` text COLLATE utf8_unicode_ci,<br />
  `Legal_Owner` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Legal_Representative` text COLLATE utf8_unicode_ci,<br />
  `State` text COLLATE utf8_unicode_ci,<br />
  `Country` text COLLATE utf8_unicode_ci,<br />
  `Banker` text COLLATE utf8_unicode_ci,<br />
  `Income_Tax_Registration_No` text COLLATE utf8_unicode_ci,<br />
  `Central_Sales_Tax_No` text COLLATE utf8_unicode_ci,<br />
  `State_Sales_Tax_No` text COLLATE utf8_unicode_ci,<br />
  `Import_Export_Code` text COLLATE utf8_unicode_ci,<br />
  `Tax_Identification_No` text COLLATE utf8_unicode_ci,<br />
  `SSI_No` text COLLATE utf8_unicode_ci,<br />
  `CIN_No` text COLLATE utf8_unicode_ci,<br />
  `SCT_No` text COLLATE utf8_unicode_ci,<br />
  `RBI_No` text COLLATE utf8_unicode_ci,<br />
  `PAN_No` text COLLATE utf8_unicode_ci,<br />
  `TAN_No` text COLLATE utf8_unicode_ci,<br />
  `EPF_No` text COLLATE utf8_unicode_ci,<br />
  `ESI_No` text COLLATE utf8_unicode_ci,<br />
  `Service_Tax_Registration_No` text COLLATE utf8_unicode_ci,<br />
  `Excise_Registration_No` text COLLATE utf8_unicode_ci,<br />
  `Dun_Bradstreet_Number` text COLLATE utf8_unicode_ci,<br />
  `Value_Added_Tax_Registration_No` text COLLATE utf8_unicode_ci,<br />
  `Industry` text COLLATE utf8_unicode_ci,<br />
  `Key_Customers` text COLLATE utf8_unicode_ci,<br />
  `DGFT_IE_Code` text COLLATE utf8_unicode_ci,<br />
  `Registration_Authority` text COLLATE utf8_unicode_ci,<br />
  `Payment_Mode` text COLLATE utf8_unicode_ci,<br />
  `Shipment_Mode` text COLLATE utf8_unicode_ci,<br />
  `Registration_No` text COLLATE utf8_unicode_ci,<br />
  `URL_ID` text COLLATE utf8_unicode_ci,<br />
  `Company_Introduction` text COLLATE utf8_unicode_ci,<br />
  `Detailed_Type` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Detailed_Profile` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Company_Profile` text COLLATE utf8_unicode_ci,<br />
  `Products_Manufacturing_and_Exporting` text COLLATE utf8_unicode_ci,<br />
  `Company_Branches` text COLLATE utf8_unicode_ci,<br />
  `Services` text COLLATE utf8_unicode_ci,<br />
  `Member_Affiliates` text COLLATE utf8_unicode_ci,<br />
  `We_Sell` text COLLATE utf8_unicode_ci,<br />
  `We_Buy` text COLLATE utf8_unicode_ci,<br />
  `Brands` text COLLATE utf8_unicode_ci,<br />
  `Factory_Size` text COLLATE utf8_unicode_ci,<br />
  `Factory_Location` text COLLATE utf8_unicode_ci,<br />
  `QA_QC` text COLLATE utf8_unicode_ci,<br />
  `Number_of_Production_Lines` text COLLATE utf8_unicode_ci,<br />
  `Number_of_RND_Staff` text COLLATE utf8_unicode_ci,<br />
  `Number_of_QC_Staff` text COLLATE utf8_unicode_ci,<br />
  `Contract_Manufacturing` text COLLATE utf8_unicode_ci,<br />
  `Registered_Location` text COLLATE utf8_unicode_ci NOT NULL,<br />
  `Registered_Address` text COLLATE utf8_unicode_ci,<br />
  `cleaned` tinyint(1) NOT NULL,<br />
  `date_modified` date NOT NULL,<br />
  `approved_date` date NOT NULL,<br />
  `delete` tinyint(1) NOT NULL,<br />
  `junk` tinyint(1) NOT NULL,<br />
  `admin_user` int(4) NOT NULL,<br />
  `update_user` bigint(2) NOT NULL,<br />
  `cr_date` datetime NOT NULL,<br />
  `buyer_supplier` tinyint(2) NOT NULL COMMENT '0-Supplier,1-Buyer,2-Both',<br />
  `company_represent` tinyint(2) NOT NULL DEFAULT '0' COMMENT '0-Yes,1-No',<br />
  PRIMARY KEY (`id`),<br />
  KEY `search_string` (`Company_name`(10),`Website1`(30),`City`(10),`State`(10),`Country`(10),`cleaned`,`delete`,`junk`,`date_modified`,`approved_date`,`admin_user`),<br />
  FULLTEXT KEY `ft_website1` (`Website1`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;]]></description>
            <dc:creator>Nagarajan B</dc:creator>
            <category>PHP</category>
            <pubDate>Sat, 13 Apr 2013 04:29:58 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,583611,583611#msg-583611</guid>
            <title>Mysql Login systeem (no replies)</title>
            <link>http://forums.mysql.com/read.php?52,583611,583611#msg-583611</link>
            <description><![CDATA[ // login form<br />
<br />
&lt;table width=&quot;300&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;checklogin.php&quot;&gt;<br />
&lt;td&gt;<br />
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td colspan=&quot;3&quot;&gt;&lt;strong&gt;Member Login&lt;/strong&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td width=&quot;78&quot;&gt;Naam&lt;/td&gt;<br />
&lt;td width=&quot;6&quot;&gt;:&lt;/td&gt;<br />
&lt;td width=&quot;294&quot;&gt;&lt;input name=&quot;naam&quot; type=&quot;text&quot; id=&quot;naam&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Email&lt;/td&gt;<br />
&lt;td&gt;:&lt;/td&gt;<br />
&lt;td&gt;&lt;input name=&quot;email&quot; type=&quot;text&quot; id=&quot;email&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Login&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/td&gt;<br />
&lt;/form&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
//einde login form<br />
<br />
//login check<br />
<br />
&lt;?php<br />
<br />
$host=&quot;&quot;; <br />
$username=&quot;&quot;; <br />
$password=&quot;&quot;;<br />
$db_name=&quot;&quot;;<br />
<br />
mysql_connect(&quot;$host&quot;, &quot;$username&quot;, &quot;$password&quot;)or die(&quot;cannot connect&quot;); <br />
mysql_select_db(&quot;$db_name&quot;)or die(&quot;cannot select DB&quot;);<br />
<br />
$naam=$_POST['naam']; <br />
$email=$_POST['email']; <br />
<br />
// To protect MySQL injection (more detail about MySQL injection)<br />
$naam = stripslashes($naam);<br />
$email = stripslashes($email);<br />
$naam = mysql_real_escape_string($naam);<br />
$email = mysql_real_escape_string($email);<br />
<br />
$sql=&quot;SELECT * FROM gebruikers WHERE naam='$naam' and email='$email'&quot;;<br />
$result=mysql_query($sql);<br />
<br />
$count=mysql_num_rows($result);<br />
<br />
if($count==1){<br />
<br />
session_register(&quot;naam&quot;);<br />
session_register(&quot;email&quot;); <br />
header(&quot;location:login_succes.php&quot;);<br />
}<br />
else {<br />
echo &quot;Wrong Username or Password&quot;;<br />
}<br />
?&gt;<br />
<br />
//einde login check<br />
<br />
//login succes<br />
<br />
&lt;?php<br />
<br />
session_start();<br />
<br />
if(!session_is_registered(naam)) {<br />
	echo 'U heeft hier niks te zoeken!!';<br />
}<br />
else {<br />
<br />
?&gt;<br />
<br />
&lt;html&gt;<br />
&lt;body&gt;<br />
Welkom, <br />
&lt;? echo $_SESSION['naam'] ?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
<br />
&lt;?<br />
}<br />
?&gt;<br />
<br />
//einde login succes<br />
<br />
//registreer form<br />
<br />
&lt;table width=&quot;300&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;registreer_verwerk.php&quot;&gt;<br />
&lt;td&gt;<br />
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#FFFFFF&quot;&gt;<br />
&lt;?php $date =('D, M, Y'); ?&gt;<br />
&lt;tr&gt;<br />
&lt;td colspan=&quot;3&quot;&gt;&lt;strong&gt;Member registreer&lt;/strong&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td width=&quot;78&quot;&gt;Naam&lt;/td&gt;<br />
&lt;td width=&quot;6&quot;&gt;:&lt;/td&gt;<br />
&lt;td width=&quot;294&quot;&gt;&lt;input name=&quot;naam&quot; type=&quot;text&quot; id=&quot;naam&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Email&lt;/td&gt;<br />
&lt;td&gt;:&lt;/td&gt;<br />
&lt;td&gt;&lt;input name=&quot;email&quot; type=&quot;text&quot; id=&quot;email&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Wachtwoord&lt;/td&gt;<br />
&lt;td&gt;:&lt;/td&gt;<br />
&lt;td&gt;&lt;input name=&quot;ww&quot; type=&quot;text&quot; id=&quot;ww&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Herhaal wachtwoord&lt;/td&gt;<br />
&lt;td&gt;:&lt;/td&gt;<br />
&lt;td&gt;&lt;input name=&quot;ww2&quot; type=&quot;text&quot; id=&quot;ww2&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;input type='hidden' name='date' value='$date'&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Login&quot;&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/td&gt;<br />
&lt;/form&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
//einde registreer form<br />
<br />
//registreer check<br />
<br />
&lt;?php<br />
<br />
$host=&quot;&quot;; <br />
$username=&quot;&quot;; <br />
$password=&quot;&quot;;<br />
$db_name=&quot;&quot;;<br />
<br />
mysql_connect(&quot;$host&quot;, &quot;$username&quot;, &quot;$password&quot;)or die(&quot;cannot connect&quot;); <br />
mysql_select_db(&quot;$db_name&quot;)or die(&quot;cannot select DB&quot;);<br />
<br />
$naam = $_REQUEST['naam'];<br />
$email = $_REQUEST['email'];<br />
$ww = $_REQUEST['ww'];<br />
$ww2 = $_REQUEST['ww2'];<br />
$date = $_REQUEST['date'];<br />
<br />
if(empty($naam)){<br />
	echo 'U moet een naam invoeren&lt;br/&gt;';<br />
}<br />
if(empty($email)){<br />
	echo 'U moet een email invoeren&lt;br/&gt;';<br />
}<br />
if(empty($ww)){<br />
	echo 'U moet een wachtwoord invoeren&lt;br/&gt;';<br />
}<br />
if($ww != $ww2){<br />
	echo 'Het wachtwoord is niet goed herhaald!';<br />
}<br />
else{<br />
	$insert = mysql_query(&quot;INSERT INTO gebruikers (naam, email, wachtwoord, datum) VALUES ('$naam', '$email', '$ww', '$date')&quot;);<br />
<br />
	if(!$insert){<br />
		die(&quot;There's little problem: &quot;.mysql_error());<br />
	}<br />
	else{<br />
		echo 'U ben geregistreerd!';<br />
	}<br />
}<br />
?&gt;<br />
<br />
//einde registreer check<br />
<br />
I hope this will help you. Reply for help]]></description>
            <dc:creator>Henk Jongebroek</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 10 Apr 2013 17:41:09 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,582691,582691#msg-582691</guid>
            <title>MySql Query Help (2 replies)</title>
            <link>http://forums.mysql.com/read.php?52,582691,582691#msg-582691</link>
            <description><![CDATA[ Hi professionals.<br />
 <br />
i am new to php and mysql and I am trying to query my database to calculate the distance with the help from google instructions on this page.<br />
 <br />
https :// developers.google.com/maps/articles/phpsqlsearch_v3<br />
 <br />
when I try to query my database with the following query as advised by them no results are returned. here is my query, I think it is because of the order of exectuion of sql statement and it does not recognise the &quot;distance&quot; column name <br />
<br />
SELECT suburb, state, latitude, longtitude, ( 6371 * acos( cos( radians(153) ) * cos( radians( latitude ) ) * cos( radians( longtitude ) - radians(-27) ) + sin( radians(153) ) * sin( radians( latitude ) ) ) ) AS distance FROM Postcode HAVING distance &lt; 25 ORDER BY distance<br />
 <br />
any ideas as I really need the distance &lt; 25 part so users can search by distance<br />
 <br />
thanks]]></description>
            <dc:creator>Alan Lynch</dc:creator>
            <category>PHP</category>
            <pubDate>Sat, 30 Mar 2013 12:20:39 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,582434,582434#msg-582434</guid>
            <title>Trouble Connecting to Database via PHP (14 replies)</title>
            <link>http://forums.mysql.com/read.php?52,582434,582434#msg-582434</link>
            <description><![CDATA[ Ok so I've got a database with a populated table (just to practice for now)<br />
<br />
I'm trying to connect to my mysql database via PHP and have found the code to help me to do just that, but when I try I get this error message on my browser:<br />
<br />
Fatal error: Call to undefined function mysqli_connect() in C:\Apache24\htdocs\mysql_connect.php on line 14<br />
<br />
I have looked at the specs of the PHP build I have installed and this is the configure command:<br />
<br />
cscript /nologo configure.js &quot;--enable-snapshot-build&quot; &quot;--disable-isapi&quot; &quot;--enable-debug-pack&quot; &quot;--without-mssql&quot; &quot;--without-pdo-mssql&quot; &quot;--without-pi3web&quot; &quot;--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared&quot; &quot;--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared&quot; &quot;--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared&quot; &quot;--enable-object-out-dir=../obj/&quot; &quot;--enable-com-dotnet=shared&quot; &quot;--with-mcrypt=static&quot; &quot;--disable-static-analyze&quot; &quot;--with-pgo&quot;<br />
<br />
I did install the latest PHP 5.4.12, should this work automatically?]]></description>
            <dc:creator>Louis Andreou</dc:creator>
            <category>PHP</category>
            <pubDate>Fri, 29 Mar 2013 16:13:31 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,581981,581981#msg-581981</guid>
            <title>php-mysql help. Need to create a dynamic url based on the table value (2 replies)</title>
            <link>http://forums.mysql.com/read.php?52,581981,581981#msg-581981</link>
            <description><![CDATA[ I have a database named 'counter' and a table named 'info'. which stores the information of client ip address (ip_address), client brower details (user_agent) and date and time visited my website (datetime).<br />
<br />
I have a php webpage which displays above information in a table format code is below,<br />
<br />
<br />
&lt;?php<br />
<br />
// ########################<br />
// ### Display visitors ###<br />
// ########################<br />
<br />
echo '&lt;h3&gt; Visitors &lt;/h3&gt;' ;<br />
<br />
$result = mysql_query(&quot;SELECT * FROM $dbtableinfo ORDER BY id DESC&quot;)<br />
or die(mysql_error()); <br />
<br />
echo &quot;&lt;table width='100%' border='0'&gt;&quot;;<br />
echo '&lt;tr&gt; &lt;td width=&quot;200&quot; bgcolor=&quot;#1AC414&quot;&gt;  IP &lt;/td&gt; &lt;td height=&quot;2&quot; bgcolor=&quot;#1AC414&quot; width=&quot;400&quot;&gt;User agent&lt;/td&gt; &lt;td height=&quot;2&quot; bgcolor=&quot;#1AC414&quot; width=&quot;169&quot;&gt; Date &amp;amp; Time&lt;/td&gt;&lt;/tr&gt;';<br />
<br />
// keeps getting the next row until there are no more to get<br />
while($row = mysql_fetch_array( $result ))<br />
{<br />
   // Print out the contents of each row into a table<br />
   echo '&lt;tr&gt;&lt;td bgcolor=&quot;#75D169&quot;&gt;';<br />
echo $row['ip_address'];<br />
   echo '&lt;/td&gt;&lt;td bgcolor=&quot;#75D169&quot;&gt;';<br />
   echo $row['user_agent'];<br />
   echo '&lt;/td&gt;&lt;td bgcolor=&quot;#75D169&quot;&gt;';<br />
   echo $row['datetime'];<br />
   echo &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;       <br />
}<br />
   echo &quot;&lt;tr&gt;&lt;td bgcolor=\&quot;#1AC414\&quot;&gt; &lt;strong&gt; Total unique IP´s &lt;/strong&gt; &lt;/td&gt;&lt;td bgcolor=\&quot;#1AC414\&quot;&gt; &lt;strong&gt; $totalips &lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;&quot; ;<br />
   echo &quot;&lt;/table&gt;&lt;br /&gt; &quot;;<br />
<br />
   ?&gt;<br />
<br />
<br />
First coulmn in the web page is the ip address of the client. Now I would like to make that as a hyperlink with this url <a href="http://iplocation.truevue.org/&lt;ip_address&gt;.html"  rel="nofollow">http://iplocation.truevue.org/&lt;ip_address&gt;.html</a><br />
<br />
Can someone assist?]]></description>
            <dc:creator>Simon Mandy</dc:creator>
            <category>PHP</category>
            <pubDate>Tue, 26 Mar 2013 14:22:52 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,581489,581489#msg-581489</guid>
            <title>How to wait for INSERT to happen before moving onto next INSERT query? (5 replies)</title>
            <link>http://forums.mysql.com/read.php?52,581489,581489#msg-581489</link>
            <description><![CDATA[ I am inserting data into, table1.  After this data is inserted I am trying to insert data into table2 to based off table1 data.  Table2 has FK from table one that I am referencing.  This is how I have my inserts setup up right now (this does not work).  Any help on how to clean this up and make it work correctly would be greatly appreciated.<br />
<br />
<pre class="bbcode">
$r = mysqli_query($dbc, &quot;INSERT INTO player(gamedate, home, away, goalsfor, goalsagainst, yellowcards, redcards) VALUES ('$gamedate','$home','$away','$goalsfor','$goalsagainst','$yellowcards','$redcards')&quot;);
if (mysqli_affected_rows($dbc) == 1) {
	echo &quot;Added game successfully&quot;;
	$playerid = mysql_insert_id();
	$gameresult = mysqli_query($dbc, &quot;INSERT INTO game(player_id, pposition, pgoalsfor, pgoalsagainst, psog, ppk, pyellowcards, predcards) VALUES ('$playerid','$pposition','$pgoalsfor','$pgoalsagainst','psog','ppk','pyellowcards','predcards')&quot;);
	if (mysqli_affected_rows($dbc) == 1) {
		echo &quot;Added Individual Stats successfully&quot;;
		mysqli_close();
	}
	else {
		echo &quot;There was an error.  Your stats were not added.&quot;;	
		mysqli_close();
	}
	mysqli_close();
}

else {
	echo &quot;There was an error.  Your game was not added.&quot;;	
	mysqli_close();
}</pre>
<br />
Thank you,<br />
Mike]]></description>
            <dc:creator>Mike Liedike</dc:creator>
            <category>PHP</category>
            <pubDate>Sun, 17 Mar 2013 01:18:23 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,581438,581438#msg-581438</guid>
            <title>Inserting records with mysqli_insert_id (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,581438,581438#msg-581438</link>
            <description><![CDATA[ I am trying to get data from a csv file and into a mysql database.  My objective for example is to get the first few records and add them to a table then get the primary id as well as a few other rcords and add them to a different table and so on.  <br />
  Th ecode I have so far works but it is buggy and inserts blank rows apparently randomly.  Any ideas why?  Also this is just sample data in the real app I would have more data and more tables to populate.<br />
<br />
&lt;?php  <br />
   $link = mysqli_connect(&quot;localhost&quot;, &quot;user&quot;, &quot;pass&quot;, &quot;test&quot;);<br />
<br />
/* check connection */<br />
if (mysqli_connect_errno()) {<br />
    printf(&quot;Connect failed: %s\n&quot;, mysqli_connect_error());    exit();}<br />
  <br />
$objCSV = fopen(&quot;registerSales.csv&quot;, &quot;r&quot;); //get data from csv file <br />
while (($objArr = fgetcsv($objCSV, 10000, &quot;,&quot;)) !== FALSE) {  <br />
$strSQL = &quot;INSERT INTO sample &quot;;  <br />
$strSQL .= &quot;(product_id,price,sku_id) &quot;;  <br />
$strSQL .= &quot;VALUES &quot;;  <br />
$strSQL .= &quot;('&quot;.$objArr[0].&quot;','&quot;.$objArr[1].&quot;','&quot;.$objArr[2].&quot;') &quot;; <br />
echo &quot;$strSQL&quot;; <br />
//$strSQL .=&quot;,'&quot;.$objArr[3].&quot;','&quot;.$objArr[4].&quot;','&quot;.$objArr[5].&quot;') &quot;;  <br />
$objQuery = mysqli_query($link, $strSQL);<br />
$i = mysqli_insert_id($link);<br />
<br />
<br />
//rerun block with new id val<br />
$strSQL = &quot;INSERT INTO table2 &quot;;  <br />
$strSQL .= &quot;(row1, row2)&quot;;  //&quot;(product_desc,product_sku_id) &quot;;  <br />
$strSQL .= &quot;VALUES &quot;;  <br />
$strSQL .= &quot;('&quot;.$i.&quot;','&quot;.$objArr[1].&quot;') &quot;; <br />
$objQuery = mysqli_query($link, $strSQL); <br />
echo &quot;$strSQL&quot; . &quot;&lt;br /&gt;&quot;;<br />
}  //end while<br />
fclose($objCSV);  <br />
  ?&gt;]]></description>
            <dc:creator>Mike Grunow</dc:creator>
            <category>PHP</category>
            <pubDate>Fri, 15 Mar 2013 14:15:12 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,581056,581056#msg-581056</guid>
            <title>mysql_fetch_assoc(): supplied argument is not a valid MySQL error (3 replies)</title>
            <link>http://forums.mysql.com/read.php?52,581056,581056#msg-581056</link>
            <description><![CDATA[ hallo,<br />
<br />
if i try do run the code below i get this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ....<br />
What could I to do make my code work? <br />
Thanks for all your effort already :).<br />
<br />
<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;<br />
	&quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt"  rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt</a>;<br />
<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Voorbeeld 9.4 - De resultaten naar het scherm schrijven met mysql_fetch_row()&lt;/title&gt;<br />
&lt;?php<br />
$server = &quot;localhost&quot;; // naam van de MySQL-databaseserver<br />
$user = &quot;root&quot;;	// inlognaam<br />
$wachtwoord = &quot;usbw&quot;;	//wachtwoord voor dit account<br />
$database = &quot;ict&quot;; // naam van de database die we gebruiken<br />
$query = mysql_query(&quot;SELECT 'naam_toneelstuk','Gerne' FROM 'table 2' WHERE 'Gerne' = 'toneel'&quot;); // de SQL-query die wordt uitgevoerd<br />
<br />
<br />
while ($row = mysql_fetch_assoc ($query) ) {<br />
<br />
	echo $row['gerne'];<br />
<br />
	echo $row['naam_toneelstuk'];<br />
}<br />
<br />
<br />
?&gt;<br />
&lt;/head&gt;<br />
<br />
&lt;body&gt;<br />
<br />
<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
<br />
<br />
niek]]></description>
            <dc:creator>niek h</dc:creator>
            <category>PHP</category>
            <pubDate>Tue, 12 Mar 2013 14:23:50 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,580940,580940#msg-580940</guid>
            <title>How to set Dynamic WHERE CONDITIONS to show customer rows depending on Login using PHP? (3 replies)</title>
            <link>http://forums.mysql.com/read.php?52,580940,580940#msg-580940</link>
            <description><![CDATA[ I have two tables in MYSQL, tblLogin and tblCustomers with the following Columns: tblLogin{LoginID as Primary_Key, UserName, Password} and tblCustomer{Customer_ID as Primary_Key, Customer_FullName, OrderID, OrderDetails, submission_date, Customer_LoginID as Foreign_key}.<br />
What I want is to let customers to view their own records only due to their login information.<br />
To accomplish this I set two forms namely Login_Form.php and Results.php where after pressing SUBMIT BUTTON of Login_Form.php the user should be able to see his own records displayed on Results.php form dynamically.<br />
Here is my code for these forms!<br />
1. Login_form.php<br />
 //Begin Login_Form.php<br />
    &lt;html&gt;<br />
    &lt;head&gt;<br />
      &lt;meta content=&quot;text/html; charset=ISO-8859-1&quot;<br />
     http-equiv=&quot;content-type&quot;&gt;<br />
      &lt;title&gt;&lt;/title&gt;<br />
    &lt;/head&gt;<br />
    &lt;body&gt;<br />
    &lt;form target=&quot;_self&quot; enctype=&quot;text/plain&quot; method=&quot;post&quot;<br />
     action=&quot;Results.php&quot; name=&quot;Login_Form&quot;&gt;&lt;label&gt;User<br />
    name&lt;/label&gt; &amp;nbsp; <br />
    &lt;label&gt;Password&lt;br&gt; &lt;br&gt; &lt;/label&gt;&lt;input name=&quot;UserName&quot; value=&quot;User Name&quot;&gt;<br />
    &amp;nbsp;&lt;input name=&quot;Password&quot; value=&quot;Password&quot;<br />
     type=&quot;password&quot;&gt;&lt;br&gt;<br />
      &lt;br&gt;<br />
    &amp;nbsp; <br />
    &amp;nbsp; &amp;nbsp; &lt;input name=&quot;Submit&quot; value=&quot;submit&quot;<br />
     type=&quot;submit&quot;&gt;&lt;br&gt;<br />
      &lt;br&gt;<br />
    &lt;/form&gt;<br />
    &lt;/body&gt;<br />
    &lt;/html&gt;<br />
       //End Login_Form.php<br />
<br />
2. Results.php<br />
//Begin results.php<br />
 &lt;?php<br />
$dbhost = 'localhost:3306';<br />
$dbuser = 'root';<br />
$dbpass = 'rootpassword';<br />
$conn = mysql_connect($dbhost, $dbuser, $dbpass);<br />
if(! $conn )<br />
{<br />
  die('Could not connect: ' . mysql_error());<br />
}<br />
$sql = 'Customer_ID, Customer_FullName, OrderID, OrderDetails,submission_date, Customer_LoginID WHERE {...YOUR HELP IS NEEDED PLEASE....?}';<br />
 <br />
mysql_select_db('tblCustomers');<br />
$retval = mysql_query( $sql, $conn );<br />
if(! $retval )<br />
{<br />
  die('Could not get data: ' . mysql_error());<br />
}<br />
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))<br />
{<br />
    echo &quot;Customer_ID :{$row['Customer_ID']}  &lt;br&gt; &quot;.<br />
         &quot;Full Name: {$row['Customer_FullName']} &lt;br&gt; &quot;.<br />
         &quot;Order Details: {$row['OrderDetails']} &lt;br&gt; &quot;.<br />
         &quot;Date : {$row['submission_date']} &lt;br&gt; &quot;.<br />
         &quot;--------------------------------&lt;br&gt;&quot;;<br />
} <br />
echo &quot;Fetched data successfully\n&quot;;<br />
mysql_close($conn);<br />
?&gt;    <br />
//End results.php<br />
<br />
Now how to fetch specific data due to specific customer? <br />
Any hint would be highly appreciated<br />
Please!!!!]]></description>
            <dc:creator>Mrkey Lee</dc:creator>
            <category>PHP</category>
            <pubDate>Wed, 13 Mar 2013 16:16:00 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,580881,580881#msg-580881</guid>
            <title>MM_Username insert into field (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,580881,580881#msg-580881</link>
            <description><![CDATA[ Hi everyone, <br />
<br />
new to php and Mysql, moved over from ms access, i am creating a website to help people monitor there requests, they login with a login name and password like <br />
<br />
login 'James Helliwell', <br />
password ABCDEF1<br />
<br />
i have a form so they enter there details in but i want it to insert the login name (MM_Username) into a filed called Account Manager<br />
<br />
i think its the below code from my site that i need to modify, teaching myself so any help would be grealty appreciated<br />
<br />
if ((isset($_POST[&quot;MM_insert&quot;])) &amp;&amp; ($_POST[&quot;MM_insert&quot;] == &quot;form2&quot;)) {<br />
  $insertSQL = sprintf(&quot;INSERT INTO RequestsMaster (FieldSalesManager, AccountManager, AccountName, RequestMonth, `Module`, ModuleDescription, OrderQty, ApprovedByFSM, PotentialExtraBusiness, FinalApproval, ShippedStatus, ShippedDate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)&quot;,<br />
                       GetSQLValueString($_POST['FieldSalesManager'], &quot;text&quot;),<br />
                       GetSQLValueString($_POST['AccountManager'], &quot;text&quot;),<br />
                       GetSQLValueString($_POST['AccountName'], &quot;int&quot;),<br />
                       GetSQLValueString($_POST['RequestMonth'], &quot;date&quot;),<br />
                       GetSQLValueString($_POST['Module'], &quot;text&quot;),<br />
                       GetSQLValueString($_POST['ModuleDescription'], &quot;text&quot;),<br />
                       GetSQLValueString($_POST['OrderQty'], &quot;int&quot;),<br />
                       GetSQLValueString($_POST['ApprovedByFSM'], &quot;int&quot;),<br />
                       GetSQLValueString($_POST['PotentialExtraBusiness'], &quot;text&quot;),<br />
                       GetSQLValueString($_POST['FinalApproval'], &quot;int&quot;),<br />
                       GetSQLValueString($_POST['ShippedStatus'], &quot;text&quot;),<br />
                       GetSQLValueString($_POST['ShippedDate'], &quot;date&quot;));<br />
<br />
  mysql_select_db($database_DePuyConnection, $DePuyConnection);<br />
  $Result1 = mysql_query($insertSQL, $DePuyConnection) or die(mysql_error());<br />
<br />
  $insertGoTo = &quot;Directory.php&quot;;<br />
  if (isset($_SERVER['QUERY_STRING'])) {<br />
    $insertGoTo .= (strpos($insertGoTo, '?')) ? &quot;&amp;&quot; : &quot;?&quot;;<br />
    $insertGoTo .= $_SERVER['QUERY_STRING'];<br />
  }<br />
  header(sprintf(&quot;Location: %s&quot;, $insertGoTo));<br />
}]]></description>
            <dc:creator>James Halliwell</dc:creator>
            <category>PHP</category>
            <pubDate>Sat, 09 Mar 2013 17:19:30 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,580872,580872#msg-580872</guid>
            <title>select and if statement (1 reply)</title>
            <link>http://forums.mysql.com/read.php?52,580872,580872#msg-580872</link>
            <description><![CDATA[ al salam alikum =)<br />
<br />
<br />
guys i want to know how to fix a complicated query<br />
<br />
<br />
i have two tables<br />
subsystem -&gt; 1st table<br />
topics -&gt; 2nd table<br />
<br />
subsystem :<br />
subid<br />
userid<br />
type<br />
typeid ;<br />
<br />
<br />
topics :<br />
topicid<br />
title<br />
catid<br />
userid ;<br />
<br />
<br />
and i got 3 records ( for example ) in the subsystem table like thie<br />
1 - 1 - user - 1<br />
2 - 1 - user - 2<br />
3 - 1 - cat - 1<br />
<br />
<br />
and i wanna to fetch the topics from topics table like this<br />
<br />
query &gt; select * from topics inner join subsystem on topics.userid=subsystem.userid where ( and here is the problem ! i want to fetch the topics where subsystem.typeid=userid &quot;if subsystem.type=user&quot; and where subsystem.typeid=catid &quot;if subsystem.type=cat&quot;)<br />
<br />
can anybody help !<br />
<br />
and thnx =)]]></description>
            <dc:creator>Hassan Ahmed</dc:creator>
            <category>PHP</category>
            <pubDate>Sat, 09 Mar 2013 17:26:11 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?52,580798,580798#msg-580798</guid>
            <title>Connecting to a database and displaying 1 result (2 replies)</title>
            <link>http://forums.mysql.com/read.php?52,580798,580798#msg-580798</link>
            <description><![CDATA[ I have been working on a code to establish conenction to a database to to retrieve the information on the database.  The database contains a list of names and a colour code next to them.<br />
<br />
I have connected to the database and can pull the information but it does not limit the number of rows that is being returned (it shows all the entries).  <br />
<br />
Can anyone look at my code and help me with something that is clearly missing???!?!  The FirstName entries are all unique so I only need to check the name with the color code.<br />
<br />
&lt;?php<br />
$con=mysqli_connect(&quot;localhost&quot;,&quot;####&quot;,&quot;####&quot;,&quot;####&quot;);<br />
// Check connection<br />
if (mysqli_connect_errno())<br />
  {<br />
  echo &quot;Failed to connect to MySQL: &quot; . mysqli_connect_error();<br />
  }<br />
<br />
$result = mysqli_query($con,&quot;SELECT * FROM Members&quot;);<br />
<br />
while($row = mysqli_fetch_array($result))<br />
  {<br />
  echo $row['FirstName'] . &quot; &quot; . $row['Level'];<br />
  echo &quot;&lt;br /&gt;&quot;;<br />
  }<br />
<br />
mysqli_close($con);<br />
?&gt;]]></description>
            <dc:creator>Chris Harris</dc:creator>
            <category>PHP</category>
            <pubDate>Sat, 09 Mar 2013 09:32:59 +0000</pubDate>
        </item>
    </channel>
</rss>
