Vikas Jayna
Members-
Posts
121 -
Joined
-
Last visited
Everything posted by Vikas Jayna
-
[code]grant all on econnect.* to iinnovationscom@localhost identified by 'password';[/code]
-
php and mysql array problem, empty array help
Vikas Jayna replied to jjcanales's topic in PHP Coding Help
The variable $email is not being assigned anywhere and hence the expression if (empty($email)) will always return true. Try changing this to if (empty($ADMIN_EMAILS)) -
Well! I'm assuming the database connections are properly set and the above code should work fine then. I wonder how the online list is maintained - is it through some flash file included in every page or something else?
-
You need to give the user 'iinnovationscom' the permissions to access the 'econnect' database. Do it through the following query: [code]grant all on econnect.* to iinnovationscom'@'localhost identified by 'password';[/code] This query will have to be run through the root user or a user that has the permissions on the database 'econnect'
-
Hi Guys! Has anyone come across a method of upgrading the databse from Mysql 4.0 to Mysql 5.0. Since my database has over a billion records it takes ages to dump the data and to populate the same in the newer version. Is there no tool devised that could directly convert the database files from one format to the other. Have been researching this for some while but no success!
-
seems as if the query returned no records. Try running the query through the database interface and see if it returns some rows.
-
And what's the parsing error that you get?
-
The style register_box will have to be used within the table elements like this: [code]class="register_box"[/code]
-
Can't understand this! Is the error a parsing error or a logical one?
-
Bitwise operator | not working correctly with hex
Vikas Jayna replied to Nolongerused3921's topic in PHP Coding Help
Could you post the expected output and the output obtained from this code -
you can try mysql replication i.e. setup your laptop as the master and the online database as the slave of this master. You would need to start replication on the online database (by using "start slave" statement) once you are connected to the network and stop replication (by using "stop slave" statement) when you are to disconnect the laptop from the network.
-
Check out this link http://dev.mysql.com/doc/refman/5.0/en/group-by-modifiers.html
-
It can happen in a single query using a join:- [code]select Callbacks.* from Callbacks,TicketsSold where Callbacks.cartID = TicketsSold.cartID and MC_EventDate in ('2006-12-09','2006-12-10','2006-12-16','2006-12-17','2006-12-23')[/code]
-
This happens because headers need to be sent before any other output in the script. Even a whitespace character sent to the browser before call to header() function will give error.
-
Hi Raconteur, Use the header() function in your php scripts that sends the database record as the output . This will ensure that it does not get cached in the browser and whenever the script is called through ajax it will give different output
-
The php code looks fine, would require a bit of hit and trial to get this right. I wonder whether the output of the script is getting cached in the browser. The same can be found by executing the php script (which is being called through ajax) from the command line, like this: [b]php -q <scriptname>[/b] Try this a few times and if this gives different results, the point is proven. Caching of php output can be stopped by using the header function like this:- [code]header("Cache-Control: no-cache, no-store, max-age=0, must-revalidate");[/code] Hope this solves the problem!
-
In php, if a variable is used without defining its type it throws a [b]NOTICE[/b]. Usually, this i disabled in the php configuration file php.ini, by using the line: [code]error_reporting = E_ALL & ~E_NOTICE[/code] which means report all errors except NOTICE. This does not seem to be the case on your machine. In case, you don't have access to the configuration file, it can still be changed at runtime by using the following line of code at the top of your script: [code]ini_set('error_reporting','E_ALL & ~E_NOTICE');[/code] Once the notice is disabled, no output will go to the browser before call to [b]session_start()[/b] function and hence no warning will be sent by session_start() function. However, [b]header()[/b] function will still send the warning as session_start() has already been sent. To avoid this, you'll have to use buffering. See the [b]ob_start()[/b] function manual http://in.php.net/manual/en/function.ob-start.php
-
Dynamic checkboxes question!(again I know)
Vikas Jayna replied to pthurmond's topic in PHP Coding Help
One slight modification, its [b]$_POST[Activity][/b] instead of [b]$_POST[$Activity][/b] -
You can try the [b]fsockopen()[/b] function. See the link http://in.php.net/manual/en/function.fsockopen.php
-
use the [b]htmlentities()[/b] function http://in.php.net/manual/en/function.htmlentities.php
-
Dynamic checkboxes question!(again I know)
Vikas Jayna replied to pthurmond's topic in PHP Coding Help
Think this should work! A better way though would be like this:- [code]$query = "SELECT Activity_ID, Name, Picture FROM Activities"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); if($result) { $i = 0; $loop = 0; while($row = mysql_fetch_array($result, MYSQL_NUM)) { if($loop == 0) { echo '<tr>'; } echo '<td width="25"><input name="Activity[]" type="checkbox" value="' . $row[0] . '"><br>' . $row[1] . '</td>'; echo '<td><img src="' . $row[2] . '" border="1" valign="middle" align="center"></td>'; $i++; if($loop == 2) { echo '</tr>'; $loop = 0; } else { $loop++; } } if($loop != 0) { if($loop == 1) { echo '<td> </td><td> </td>'; } else if($loop == 2) { echo '<td> </td>'; } echo '</tr>'; } }[/code] And the second code could be like this:- [code]$actarray = $_POST[$Activity];[/code] Basically, [b]$_POST[$Activity][/b] will be an array containing the values of all the checkboxes that have been checked.