programming

How do I call a remote plist?

How do I call a remote plist for use in my application?

How to reuse the same query on the page

I have added my first php page to add a dynamic page but need to display the results of a my sql query in different sections.

For a menu to link to its own page and display a summary of each seperatly on the page.

<?php
$query
= mysql_query("SELECT * FROM descriptions");
while (
$row=mysql_fetch_array($query)){
  print
'<a href='more.php?id=' . $row['id'] . '">' . $row['name'] . '</a><br />';
}

?>

PHP date questions (GetYear,GetMonth,GetDay)?

Does PHP have functions for GetYear, GetMonth, & GetDay

example:
$Date = 2009-8-7;
$Year = GetYear($Date);
print $Year;//print 2009
and so on . . .

I know there are mysql results but nevery any in php

I have a query that never returns any results or errors. When I run the sql directly through phpmyadmin the results come back fine.

just trying to dump row right now to see whats coming back

<?php
$link
= mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!
$link) {
    die(
'Could not connect: ' . mysql_error());
}

$sql = "SELECT ProductID,Name FROM products WHERE ProductID > 5 ORDER BY ProductID DESC";
$query = mysql_query($sql);
while (
$row = mysql_fetch_object($query)){
var_dump($row);
}
?>

Warning: session_start() [function.session-start]: Cannot send session cookie

I'm just starting php and test page was working but now getting
Warning: session_start() [function.session-start]: Cannot send session cookie

I just made some minor edits and now its not working.

How do I stop double posts in php

I'm helping someone with an old someone else made admin program to add / edit / delete records

Some of the people working on it are always pressing the back and forward button and reposting the info multiple times. Is there a way keep this from happening?

not the real code but close enough

<form method="post" action="addrecord.php">
<input type="text" name="title" />
..
..
..
<input type="submit" value="Add Record" />
</form>

The addrecord.php page

<?
include_once('dataconnection.php');
$title=$_POST['title'];
more fields
.
.
.

Query results into an array only storing one result

I'm successfully connecting to a mssql database and getting results, but I'm trying to place them in an array for display on the page.

The following always gets 1 result and nothing more.
I thought arrays are supposed to store multiple results?

<?php

$conn=odbc_connect('*****','******','*****');
if (!$conn)
{exit("Connection Failed: " . $conn);}

$sql="select Name,Id,Group from members";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");
echo '';

while (odbc_fetch_row($rs))
{
$id=odbc_result($rs,"Id");

How turn one variable into two in PHP

I have a form that only has one field for name and I want to get the two values submitted and store first and last as seperate values in the database. How would I do that?

<?php
$name
= $_POST['name'];
...
?>

Syndicate content