如何使用postgres和php选择主键cusomter id

时间:2017-11-04 01:14:12

标签: php postgresql select associative-array

我试图抓住插入postgres后创建的最新customer_id似乎无法正常工作

$result = pg_query_params($dbconn, 'SELECT customer_id FROM customer WHERE
first_name=$1 AND last_name=$2 ORDER BY customer_id DESC LIMIT 1',
array($first_name, $last_name));

$resultRow = pg_fetch_assoc($result);

echo $resultRow['customer_id'];

我需要做些什么才能让customer_id显示

0 个答案:

没有答案